The Turtle Trading ChannelTurtle Rules:
To trade exactly like the turtles did, you need to set up two indicators representing the main and the failsafe system.
Set up the main indicator with TradePeriod = 20 and StopPeriod = 10 (A.k.a S1)
Set up the failsafe indicator with TradePeriod = 55 and StopPeriod = 20 (A.k.a S2)
The entry strategy using S1 is as follows
Buy 20-day breakouts using S1 only if last signaled trade was a loss.
Sell 20-day breakouts using S1 only if last signaled trade was a loss.
If last signaled trade by S1 was a win, you shouldn't trade -Irregardless of the direction or if you traded last signal it or not-
The entry strategy using S2 is as follows:
Buy 55-day breakouts only if you ignored last S1 signal and the market is rallying without you
Sell 55-day breakouts only if you ignored last S1 signal and the market is pluging without you
The turtles had a progressive position sizing approach that boosted their winnings. Once a trading decision has been made you should...
Enter the market with 2% risk. Place stop-loss 2ATR from the opening price.
If the position moves in your favor 1/2ATR, enter the market again with 2% risk and trail all stop-losses 2ATR from current price.
If the position moves in your favor 1/2ATR, enter the market again with 2% risk and trail all stop-losses 2ATR from current price.
If the position moves in your favor 1/2ATR, enter the market again with 2% risk and trail all stop-losses 2ATR from current price.
Stop adding to positions when 4 positions have been taken. (*** And see money management rule below)
The exit strategy is carried out using the line with the shortest period of the indicator:
Exit longs taken using S1 when price action closes below a 10-day low
Exit shorts taken using S1 when price action closes above a 10-day high
Exit longs taken using S2 when price action closes below a 20-day low
Exit shorts taken using S2 when price action closes avove a 20-day high
The turtles had very strict money management too. Initial position risk was 2%, but it decreased according to the current drawdown.
If the account had a 10% drawdown, the risk for each trade should decrease a 20%
If the account had a 20% drawdown, the risk for each trade should decrease a 40%.
If the account had a 30% drawdown, the risk for each trade should decrease a 60%.
So, if the account had a N% drawdown, the risk for each trade should decrease N*2%. 
Spanish Traslation :
Reglas de las tortugas:
Para tradear exactamente como lo hacían las tortugas, debe configurar dos indicadores que representen el sistema principal y el de seguridad .
Configure el indicador principal con TradePeriod = 20 y StopPeriod = 10 (Aka S1 )
Configure el indicador de seguridad con TradePeriod = 55 y StopPeriod = 20 usando un color diferente. (También conocido como S2 )
La estrategia de entrada usando S1 es la siguiente
Compre rupturas de 20 días usando S1 solo si la última operación señalada fue una pérdida.
Venda rupturas de 20 días usando S1 solo si la última operación señalada fue una pérdida.
Si la última operación señalada por S1 fue una victoria, no debe operar, independientemente de la dirección o si la última operación la realizó o no.
La estrategia de entrada con S2 es la siguiente:
Compre rupturas de 55 días solo si ignoró la última señal S1 y el mercado se está recuperando sin usted
Venda rupturas de 55 días solo si ignoró la última señal S1 y el mercado se está disparando sin usted
Las tortugas tenían un enfoque de tamaño de posición progresivo que aumentó sus ganancias. Una vez que se haya tomado una decisión comercial, debe ...
Ingresar al mercado con un 2% de riesgo. Coloque el stop-loss 2ATR desde el precio de apertura.
Si la posición se mueve a su favor 1 / 2ATR, ingrese al mercado nuevamente con un 2% de riesgo y arrastre todos los stop-loss 2ATR del precio actual.
Si la posición se mueve a su favor 1 / 2ATR, ingrese al mercado nuevamente con un 2% de riesgo y arrastre todos los stop-loss 2ATR del precio actual.
Si la posición se mueve a su favor 1 / 2ATR, ingrese al mercado nuevamente con un 2% de riesgo y arrastre todos los stop-loss 2ATR del precio actual.
Deje de agregar posiciones cuando se hayan tomado 4 posiciones. (*** Y vea la regla de administración de dinero a continuación)
La estrategia de salida se realiza utilizando la línea de menor periodo del indicador:
Salga de largos tomados usando S1 cuando la acción del precio cierra por debajo de un mínimo de 10 días
Salga de los cortos tomados con S1 cuando la acción del precio cierre por encima de un máximo de 10 días
Salga de largos tomados usando S2 cuando la acción del precio cierra por debajo de un mínimo de 20 días
Salga de los cortos tomados con S2 cuando la acción del precio se cierre evite un máximo de 20 días
Las tortugas también tenían una administración de dinero muy estricta . El riesgo de la posición inicial fue del 2%, pero disminuyó de acuerdo con la reducción actual.
Si la cuenta tiene una reducción del 10%, el riesgo de cada operación debería disminuir un 20%.
Si la cuenta tiene una reducción del 20%, el riesgo de cada operación debería disminuir un 40%.
Si la cuenta tiene una reducción del 30%, el riesgo de cada operación debería disminuir un 60%.
Entonces, si la cuenta tiene una reducción del N%, el riesgo de cada operación debería disminuir N * 2%.
Поиск скриптов по запросу "stop loss"
MACD Trading System - Professional V2# MACD Trading System - Professional V2
## Executive Summary
**MACD Pro V2** is an institutional-grade trading indicator combining classical MACD analysis with advanced risk management, multi-timeframe confirmation, and comprehensive performance metrics. Designed for both manual traders and algorithmic systems, this indicator provides actionable signals with built-in stop loss calculation, take profit targets, position sizing, and trailing stop logic.
This indicator is NOT just a signal generator—it's a complete trading system with risk/reward management, performance tracking, and market regime detection.
---
## Core Features
### 1. Advanced MACD Calculation
- **Customizable EMAs**: Fast (default 8), Slow (default 21), Signal (default 5)
- **Confirmed Signals**: Uses barstate.isconfirmed to prevent repainting
- **Zero-Line Position**: Shows MACD above/below zero for momentum context
### 2. Multi-Timeframe Analysis
- **4 Simultaneous Timeframes**: 4H, 1H, 15M, 5M analyzed in parallel
- **MTF Alignment Score**: 0-100% showing consensus across timeframes
- **Smart Requests**: Uses lookahead=barmerge.lookahead_off for accuracy
### 3. Market Regime Detection
Automatically identifies current market conditions:
- **TRENDING** - ADX > 25, strong directional movement
- **RANGING** - ADX < 20, choppy sideways movement
- **VOLATILE** - ATR > 1.5x average, high uncertainty
- **NORMAL** - Default market state
### 4. Integrated Risk Management
Complete position management system:
- **Stop Loss Calculation**: Automatic SL placement based on ATR × multiplier
- **Take Profit Targets**: Calculated using Risk:Reward ratio (default 2:1)
- **Position Sizing**: Scales position size based on account risk percentage
- **Trailing Stop**: Dynamically adjusts SL as price moves in your favor
- **Drawdown Monitoring**: Tracks maximum drawdown vs account
### 5. Advanced Signal Scoring
0-100 point system weighing:
- **MTF Alignment (35%)**: Multi-timeframe confirmation strength
- **Momentum (25%)**: RSI conditions + Divergence detection
- **Volume (20%)**: Volume profile and confirmation
- **Volatility (20%)**: Market regime adjustment
**Signal Classifications:**
- **STRONG (70+)**: High confidence, tight stops, optimal entry
- **MEDIUM (50-69)**: Valid signals, confirm with price action
- **WEAK (<50)**: Low conviction, skip or use tight risk management
### 6. Professional Performance Metrics
Real-time trading statistics:
- **Win Rate**: Percentage of winning trades
- **Max Drawdown**: Largest peak-to-trough decline
- **Sharpe Ratio**: Risk-adjusted returns (anualized)
- **Profit Factor**: Gross profit / Gross loss ratio
- **Consecutive Losses**: Psychological stress indicator
### 7. Advanced Filtering System
- **Divergence Detection**: Automatic bullish/bearish divergence identification
- **Support/Resistance**: Pivot-based dynamic S/R levels
- **Volume Confirmation**: Only takes signals with volume > 1.0x average
- **Session Filter**: Optional trading hours restriction
- **Volatility Adjustment**: Reduces entries in extremely high volatility
---
## How It Works
### Signal Generation Process
**Step 1: MACD Crossover**
- Crossover of MACD above/below signal line triggers base signal
- Uses confirmed values to prevent false signals
**Step 2: Multi-Timeframe Confirmation**
- Checks trend alignment on 4H, 1H, 15M, 5M
- Calculates MTF alignment percentage
- Higher alignment = higher confidence
**Step 3: Advanced Scoring**
Signal is scored on 100-point scale:
- MTF alignment contribution (35 pts max)
- RSI + Divergence (25 pts max)
- Volume profile (20 pts max)
- Volatility regime adjustment (20 pts max)
**Step 4: Filter Application**
- Session filter (if enabled)
- Support/Resistance proximity bonus
- Volume confirmation requirement
- Drawdown check (if risk mgmt enabled)
**Step 5: Risk Calculation**
- Stop Loss placed 2 ATR below entry (customizable)
- Take Profit calculated using 2:1 risk/reward ratio
- Position size scaled to risk 1% per trade
- Trailing stop activated after 1R profit
**Step 6: Signal Output**
- Buy Signal: Green triangle (Strong) or circle (Medium)
- Sell Signal: Red triangle (Strong) or circle (Medium)
- Dashboard shows complete trade details
---
## Trading Scenarios
### Scenario 1: Strong Buy Setup
```
Requirements met:
✓ MACD crosses above signal line
✓ 3/4 timeframes bullish (4H, 1H, 15M)
✓ RSI oversold (< 30)
✓ Volume spike confirmed
✓ Score: 78/100 → STRONG BUY
System provides:
- Entry: Current price
- Stop Loss: 2 ATR below entry
- Take Profit: 2× risk distance above
- Position Size: Adjusted to 1% account risk
- Trailing Stop: Activates at 1R profit
```
### Scenario 2: Medium Buy with Divergence
```
Requirements met:
✓ MACD crosses above signal line
✓ 2/4 timeframes bullish (4H, 1H)
✓ Bullish divergence detected
✓ Price near support level
✓ Score: 62/100 → MEDIUM BUY
Considerations:
- Lower confidence → tighter risk management
- Use smaller position size
- Require additional confirmation
- Better as counter-trend entry
```
### Scenario 3: Ranging Market Filter
```
Market condition detected: RANGING
ADX < 20, sideways movement
System response:
- Reduces signal score by volatility adjustment
- May skip signals entirely
- Prioritizes higher confluence
- Warns of low trend probability
Best action: Wait for trending market
```
---
## Risk Management Deep Dive
### Stop Loss Calculation
```
Stop Loss Distance = ATR × ATR Multiplier (default 2.0)
Example:
- Current price: 1.0850
- ATR(14): 0.0045
- SL Distance: 0.0045 × 2.0 = 0.009
- BUY SL: 1.0850 - 0.009 = 1.0760
```
### Position Sizing
```
Position Size = (Account Risk % / Price Risk %)
Example:
- Risk per trade: 1% of account
- Stop distance: 0.009 on price of 1.0850
- Price risk: 0.009 / 1.0850 = 0.83%
- Position size: 1.0% / 0.83% = 1.2x (capped at 1.0x max)
```
### Trailing Stop Logic
```
Normal SL: 2 ATR below entry
Trigger Level: Entry + (Entry - SL) × Trail Activation (1.0R)
Trailing Mechanism:
- If price hits trigger, trailing SL activates
- SL moves up to: Close - 2 ATR
- SL never moves down, only up (for longs)
- Protects profits while allowing upside
```
### Drawdown Protection
```
Tracks:
- Peak equity reached
- Current drawdown from peak
- Maximum drawdown recorded
- Stops trading if max DD exceeded
Example:
- Peak: $10,000
- Current: $9,200
- Drawdown: 8%
- Max allowed: 10%
- Status: CONTINUE TRADING
```
---
## Dashboard Metrics Explained
### Market Section
- **Market Regime**: Current state (Trending/Ranging/Volatile/Normal)
- **ADX Value**: Trend strength indicator (0-100)
### Position Section
- **Current Position**: LONG, SHORT, or NONE
- **P&L**: Unrealized profit/loss percentage if in position
### Timeframe Section
- Individual 4H/1H/15M trend status
- **Alignment**: Percentage of bullish timeframes
### Risk Management Section
- **Stop Loss %**: Distance from current price
- **Take Profit %**: Target profit distance
- **Position Size**: Capital allocation multiplier
- **Risk %**: Per-trade risk percentage
### Performance Section
- **Win Rate**: % of winning trades (>60% is excellent)
- **Max DD**: Maximum drawdown experienced
- **Sharpe Ratio**: Risk-adjusted return metric
- **Profit Factor**: Ratio of profits to losses
### Indicators Section
- **RSI**: Momentum and overbought/oversold levels
- **Volume**: Current vs. average volume ratio
- **Divergence**: Active divergence detection
---
## Advanced Features
### Divergence Detection
```
Bullish Divergence:
- Price makes lower low
- MACD makes higher high
- Signals potential reversal UP
Bearish Divergence:
- Price makes higher high
- MACD makes lower low
- Signals potential reversal DOWN
Lookback: 20 bars (customizable)
```
### Support & Resistance
```
Method: Pivot High/Low detection
- Pivot Left/Right: 10 bars
- Dynamic S/R levels update as new pivots form
- Bonus score if entry near identified levels
```
### Performance Tracking
Real-time statistics calculated from:
- Win/loss signals
- Profit/loss per trade
- Consecutive losing trades
- Cumulative returns
- Standard deviation (Sharpe calculation)
Stores last 100 trades in memory for statistics.
---
## Input Parameters Explained
### MACD Settings
- **Fast EMA** (5-13): Lower = more responsive, more false signals
- **Slow EMA** (20-26): Higher = smoother, misses faster moves
- **Signal EMA** (5-9): Crossover sensitivity
### Risk Management
- **ATR Period** (default 14): Volatility measurement period
- **SL ATR Multiplier** (1.5-3.0): Stop loss tightness
- **Risk:Reward Ratio** (1-5): Profit target calculation
- **Trail Activation** (0.5-2.0): When to start trailing stop
- **Risk Per Trade** (0.1-5.0): Account risk percentage
- **Max Drawdown** (5-30%): Trading pause threshold
### Scoring Weights
Customize signal emphasis:
- **MTF Alignment** (35%): How important is multi-timeframe
- **Momentum** (25%): RSI and divergence weight
- **Volume** (20%): Volume confirmation priority
- **Volatility** (20%): Regime adjustment strength
### Advanced Filters
- **Check Divergence**: Enable/disable divergence scoring
- **Session Filter**: Restrict to specific hours
- **Min Volume Ratio**: Minimum volume for signal
### Display
- **Show Dashboard**: Main metrics table
- **Show Performance**: Trading statistics
- **Show S/R Levels**: Support/resistance visualization
---
## Best Practices
1. **Backtest Before Trading**: Test parameters on your preferred pairs
2. **Start with Strong Signals**: Use only 70+ scored signals initially
3. **Position Size**: Never risk more than 1-2% per trade
4. **Market Regime Awareness**: Skip ranging market entries
5. **Volume Confirmation**: Always check volume spikes
6. **Profit Taking**: Lock in profits at TP, don't let winners die
7. **Loss Management**: Honor stop losses, don't move them
8. **Performance Review**: Check metrics weekly, adjust if needed
---
## Trading Strategy Examples
### Conservative Strategy (Win-Rate Focus)
```
Settings:
- Signal Score Minimum: 70+ (Strong only)
- Risk Per Trade: 0.5%
- Risk:Reward: 3:1
- Position Size: 0.5x (smaller)
Targets:
- Win Rate > 65%
- Max DD < 5%
- Profit Factor > 2.0
```
### Aggressive Strategy (Profit Focus)
```
Settings:
- Signal Score Minimum: 50+ (Medium+)
- Risk Per Trade: 2%
- Risk:Reward: 1.5:1
- Position Size: 1.0x (maximum)
Targets:
- Win Rate > 55%
- Max DD < 10%
- Profit Factor > 1.5
```
### Trend Trading Strategy
```
Settings:
- Only trade when ADX > 25 (Trending)
- MTF Alignment: 3+ timeframes
- Use Trailing Stop: Yes
- Risk:Reward: 2.5:1
Focus on: Riding large moves
Best on: 4H timeframe
Pairs: Trending majors (EURUSD, GBPUSD)
```
### Divergence Trading Strategy
```
Settings:
- Signal Score Minimum: 60+
- Enable Divergence: Yes
- Volume Confirmation: Required
- Position Size: 0.75x
Focus on: Reversal entries
Best setup: Divergence at resistance/support
Risk management: Tight stops (1.5 ATR)
```
---
## Advantages
✓ Complete trading system, not just signals
✓ Built-in risk management and position sizing
✓ Real-time performance tracking
✓ Multi-timeframe confirmation reduces false signals
✓ Advanced filtering and divergence detection
✓ Market regime awareness
✓ Customizable scoring weights
✓ Professional dashboard display
✓ Support/resistance integration
✓ Trailing stop logic for profit protection
---
## Limitations
- Lagging indicator (uses confirmed bars)
- Works best on trending markets
- Not optimized for news/event trading
- Requires parameter optimization per pair
- Performance varies by timeframe
- Past performance doesn't guarantee future results
- Can produce whipsaw signals in ranging markets
---
## System Requirements
- TradingView Premium or higher (for advanced charting)
- Recommended: 4H or 1H timeframe
- Historical data: Minimum 100 bars
- Currency pairs: Works on all FX pairs, stocks, commodities
---
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice and does not guarantee profits. Past performance does not predict future results.
**Important Notices:**
- Always use proper risk management
- Trade only with capital you can afford to lose
- Backtest thoroughly before live trading
- Combine with your own analysis
- Consider external market factors and news
- Monitor positions actively
- Keep emotional discipline
---
## Support & Optimization
For best results:
1. Test on your preferred instrument (6-12 months history)
2. Adjust MACD parameters to your timeframe
3. Optimize scoring weights to your style
4. Set risk management per your account size
5. Document your trade results and review weekly
6. Adapt parameters if performance degrades
This is a powerful system when used correctly. Respect the rules and let statistics work in your favor.
Trading Mastery Indicator# Trading Mastery Indicator - Complete User Guide
## Overview
The Trading Mastery Indicator is a professional-grade technical analysis tool that provides high-probability trading signals with complete trade management information including entry, stop loss, and take profit levels.
## Key Features
- High-Quality Signal Detection: Identifies strong, medium, and weak trading opportunities
- Complete Trade Setup: Provides entry, stop loss, and take profit for every signal
- Risk Management: Calculates risk-to-reward ratios automatically
- Elliott Wave Analysis: Integrated wave pattern and position analysis
- Active Signal Tracking: Shows when you're currently in a trade
- Professional Alerts: Detailed notifications with all trade parameters
## Signal Quality Classification
### STRONG Signals (Premium Quality)
- Reliability: Highest probability setups
- Market Conditions: Strong trending environments
- Color: Teal for buys, Red for sells
- When to Trade: These are your primary trading opportunities
- Risk Profile: Lowest risk, highest reward potential
### MEDIUM Signals (Standard Quality)
- Reliability: Good probability setups
- Market Conditions: Moderate trend or consolidation breakouts
- Color: Gold for buys, Purple for sells (Change to Blue Gray)
- When to Trade: Secondary opportunities when strong signals are scarce
- Risk Profile: Moderate risk, good reward potential
### WEAK Signals (Entry Quality)
- Reliability: Lower probability setups
- Market Conditions: Counter-trend or unclear market structure
- Color: Coral for buys, Pink for sells
- When to Trade: Only for experienced traders in specific market conditions
- Risk Profile: Higher risk, variable reward
## How to Use the Indicator
### 1. Signal Settings Configuration
Signal Filter Options:
- All Signals: Shows every trading opportunity (strong, medium, weak)
- High Quality Only: Shows only the highest probability setups
- High + Medium Quality**: Balanced approach filtering out weak signals
Recommended Settings by Experience:
- Beginner: Use "High Quality Only"
- Intermediate: Use "High + Medium Quality" 
- Advanced: Use "All Signals" with proper risk management
Label Controls:
- Label Position: Adjust how close labels appear to candles
- Label Text Size: Choose based on screen size and preference
- Maximum Labels: Control chart clutter (recommended: 20)
### 2. Understanding the Professional Panel
The panel provides real-time market intelligence:
Primary Trend: Market direction analysis
- BULLISH TREND: Look for buy opportunities only
- BEARISH TREND: Look for sell opportunities only  
- CONSOLIDATION: Market indecision, trade with caution
Wave Pattern: Elliott Wave structure analysis
- IMPULSE UP: Strong bullish momentum
- IMPULSE DOWN: Strong bearish momentum
- CORRECTION: Sideways/corrective movement
Wave Position: Current Elliott Wave position
- WAVE 3 (STRONG): Most powerful moves, best for trend following
- WAVE 1 OR 5: Beginning or ending waves
- WAVE 2 OR 4: Corrective phases, lower probability
- CORRECTIVE ABC: Wait for pattern completion
Signal Grade: Current signal status
- SIGNAL ACTIVE: You're currently in a trade
- PREMIUM/STANDARD/SPECULATIVE: New signal quality
- NO SIGNAL: No current opportunities
Trading Bias: Overall market direction
- LONG BIAS: Focus on buy opportunities
- SHORT BIAS: Focus on sell opportunities
- NEUTRAL: No clear directional bias
### 3. Reading Signal Labels
Each signal provides complete trade setup information:
```
STRONG BUY
━━━━━━━━━━━━━━━━━━━━
💰 Entry: 1875.50
🛡️  SL: 1860.25
🎯 TP: 1905.75
📈 R:R = 1:2.0
━━━━━━━━━━━━━━━━━━━━
```
Understanding the Information:
- Entry: Exact price level to enter the trade
- SL: Stop loss level (risk management)
- TP: Take profit level (profit target)
- R:R: Risk-to-reward ratio (1:2.0 means you risk 1 to make 2)
### 4. Entry/TP/SL Level Lines
Visual trade management aids:
- Blue Solid Line: Entry level
- Red Dashed Line: Stop loss level
- Green Dashed Line: Take profit level
- Small Labels: "ENTRY", "SL", "TP" markers
## Trading Strategy Guidelines
### Trend Following Strategy
1. Check Panel: Ensure trend aligns with your trade direction
2. Wait for Signals: Only trade in the direction of the primary trend
3. Quality First: Focus on STRONG signals during trending markets
4. Wave Timing: WAVE 3 positions offer the best trending opportunities
### Reversal Strategy
1. Look for Divergence: Panel shows trend change signals
2. Wait for Confirmation: Don't jump early on potential reversals
3. Use MEDIUM Signals: Often good for catching early trend changes
4. Watch Wave Position: CORRECTIVE ABC patterns may signal trend completion
### Risk Management Rules
Position Sizing:
- Risk no more than 1-2% of account per trade
- Use the provided R:R ratios to calculate position sizes
- Stronger signals can justify slightly larger positions
Stop Loss Management:
- Always use the provided stop loss levels
- Never move stops against your position
- Consider trailing stops once trade moves in your favor
Take Profit Strategy:
- Use provided TP levels as minimum targets
- Consider taking partial profits at TP level
- Let strong trends run beyond TP in trending markets
## Best Practices by Timeframe
### Scalping (M1-M5)
- Use "High Quality Only" filter
- Focus on STRONG signals only
- Quick entry and exit
- Expect more false signals due to market noise
### Intraday Trading (M15-H1)
- Use "High + Medium Quality" filter
- Good balance of opportunity and reliability
- Hold trades for several hours
- Most versatile timeframe for the indicator
### Swing Trading (H4-Daily)
- Use "All Signals" with proper analysis
- Hold trades for days to weeks
- Most reliable signals on higher timeframes
- Best for beginners due to less noise
## Panel Customization
Position Options:
- Top Right: Default, doesn't interfere with price action
- Top Left: Good for wide screens
- Bottom corners: Keeps important info visible while analyzing tops
- Middle positions: Central reference, good for multi-monitor setups
Size Options:
- Small: Minimal screen space, good for small screens
- Normal: Balanced visibility and space usage
- Large: Easy reading, good for detailed analysis
Transparency: Adjust 0-95% based on preference and chart background
## Common Mistakes to Avoid
### Signal Interpretation Errors
- Don't ignore the trend: Trading against primary trend reduces success
- Don't chase weak signals: Focus on quality over quantity
- Don't ignore wave position: WAVE 2/4 corrections are lower probability
### Risk Management Errors
- Don't skip stop losses: Every signal includes SL for a reason
- Don't risk too much: Even strong signals can fail
- Don't move stops against position: Stick to the plan
### Psychological Errors
- Don't overtrade: Wait for quality setups
- Don't second-guess strong signals: Trust the analysis
- Don't panic on normal drawdowns: Expect some losing trades
## Alert Configuration
Enable alerts for:
- Strong signals: Primary trading opportunities
- Medium signals: Secondary opportunities (optional)
- Signal active status: Know when you're in trades
Alert messages include complete trade information for easy execution.
## Performance Optimization
### For Best Results:
1. Combine with price action: Look for confluence with support/resistance
2. Consider market sessions: Different sessions have different characteristics  
3. Monitor news events: Avoid trading during high-impact news
4. Keep a trading journal: Track which signals work best for your style
### Regular Review:
- Weekly analysis: Review which signal types performed best
- Timeframe assessment: Determine your most profitable timeframes
- Strategy refinement: Adjust filters based on performance data
## Troubleshooting
If you're not seeing signals:
- Check that "Show Buy/Sell Signals" is enabled
- Verify your signal filter isn't too restrictive
- Market may be in a consolidation phase
If labels are cluttered:
- Reduce "Maximum Labels to Show"
- Change label position to "Far from Candle"
- Use smaller label text size
If panel is in the way:
- Change panel position
- Increase transparency
- Reduce panel size
- Toggle panel off temporarily
Remember: This indicator provides analysis and signals, but successful trading also requires proper risk management, emotional discipline, and understanding of market conditions. Always practice with demo accounts before risking real capital, and never risk more than you can afford to lose.
OptionHawk1. What makes the script original?
• Unique concept: It integrates a Keltner based custom supertrend with a multi-EMA energy visualization, ATR based multi target management, and on chart options (CALL/PUT) trade signals—creating a toolkit not found in typical public scripts.
• Innovative use: Instead of off the shelf indicators, it reinvents them:
• Keltner bands used as dynamic Supertrend triggers.
• Fifteen EMAs layered for “energy” zones (bullish/bearish heatmaps).
• ATR dynamically scales multi-TP levels and stop loss.
These are creatively fused into a unified signal and automation engine.
________________________________________
2. What value does it provide to traders?
• Clear entries & exits: Labels for entry price/time, five TP levels, and SL structure eliminate guesswork.
• Visualization & automation: Real-time bar coloring and energy overlays allow quick momentum reads.
• Targeted to common pain points: Many traders struggle with manual TP/SL and entry timing—this automates that process.
• Ready for real use: Just plug into intraday (e.g., 5 min) or swing setups; no manual calculations. Signals are actionable out of the box.
________________________________________
3. Why invite only (worth paying)?
• Proprietary fusion: Public indicators like Supertrend or EMA are common—but your layered use, ATR based scaling, and label logic are exclusive.
• Auto-generated options format: Unique labeling for CALL/PUT, with graphical on chart signals, isn’t offered freely elsewhere.
• Time-saver & edge-provider: Saves traders hours of configuration and enhances consistency—worth the subscription cost over piecing together mash ups.
________________________________________
4. How does it work?
• Signal backbone: Custom supertrend uses Keltner bands crossing with close for direction, filtered by trend direction EMAs.
• Multi time logic: Trend defined by crossover of price over dynamic SMA thresholds built from ATR.
• Energy bar-colors/EMAs: 15 fast EMAs color-coded green/red to instantly show momentum.
• Entry logic: “Bull” when close crosses above supertrend; “Bear” when crosses below.
• Risk management: SL set at previous bar; up to 5 ATR scaled targets (or percentage based).
• Options formatted alerts: CALL/PUT labels with ₹¬currency values, embedded timestamp, SL/TP all printed on the chart.
________________________________________
5. How should traders use it?
• Best markets & timeframes: Ideal for intraday / low timeframe (1 15m) setups and 1 hour swing trades in equities, indices, options.
• Conditions: Works best in trending or volatility driven sessions—visible via Keltner bands and EMA energy alignment.
• Recommended combo: Use alongside volume filters or broader cycles; when supertrend & energy EMAs align, validation is stronger.
________________________________________
6. Proof of effectiveness?
• On chart visuals: Entry/exit labels, confirmed labels, TP and SL markers make past hits obvious.
• Real trade examples: Highlighted both bull & bear setups with full profit realization or SL hits.
• Performance is paint tested: Easy to showcase historic signals across multiple tickers.
• Data-backed: Users can export chart data to calculate win rate and avg return per trade.
________________________________________
Summary Pitch:
OptionHawk offers a holistic, execution-ready trading tool:
1. Proprietary blend of Keltner-supertrend and layered EMAs—beyond standard scripts.
2. Automates entries, multi-tier targets, SL, and options-format labels.
3. Visual energy overlays for quick momentum readings.
4. Use-tested in intraday and swing markets.
5. Installs on chart and works immediately—no setup complexity.
It's not a public indicator package; it's a self-contained, plug and play trade catalyst—worth subscribing for active traders seeking clarity, speed, and structure in their decision-making.
6. While OptionHawk is designed for clarity and structure, no script can predict the market. Always use with discretion and proper risk management.
---------------------------------------------------------------------------------------------------------------------
OptionHawk: A Comprehensive Trend-Following & Volatility-Adaptive Trading System
The "OptionHawk" script is a sophisticated trading tool designed to provide clear, actionable signals for options trading by combining multiple technical indicators and custom logic. It aims to offer a holistic view of market conditions, identifying trend direction, momentum, and potential entry/exit points with dynamic stop-loss and take-profit levels.
________________________________________
1. Why These Specific Indicators and Code Elements?
The "OptionHawk" script is a strategic fusion of the Supertrend indicator (modified with Keltner Channels), a multi-EMA "Energy" ribbon, dynamic trend lines (based on SMA and ATR), a 100-period Trend Filter EMA, and comprehensive trade management logic (SL/TP). My reason and motivation for this mashup stem from a desire to create a robust system that accounts for various market aspects often overlooked by individual indicators:
• Supertrend with Keltner Channels: The standard Supertrend is effective for trend identification but can sometimes generate whipsaws in volatile or ranging markets. By integrating Keltner Channels into the Supertrend calculation, the volatility measure becomes more adaptive, using the (high - low) range within the Keltner Channel for its ATR-like component. This aims to create a more responsive yet less prone-to-false-signals Supertrend.
• Multi-EMA "Energy" Ribbon: This visually striking element, composed of 15 EMAs, provides a quick glance at short-to-medium term momentum and potential support/resistance zones. When these EMAs are stacked and moving in one direction, it indicates strong "energy" behind the trend, reinforcing the signals from other indicators.
• Dynamic Trend Lines (SMA + ATR): These lines offer a visual representation of support and resistance that adapts to market volatility. Unlike static trend lines, their ATR-based offset ensures they remain relevant across different market conditions and asset classes, providing context for price action relative to the underlying trend.
• 100-Period Trend Filter EMA: A longer-period EMA acts as a higher-timeframe trend filter. This is crucial for confirming the direction identified by the faster-acting Supertrend, helping to avoid trades against the prevailing broader trend.
• Comprehensive Trade Management Logic: The script integrates automated calculation and display of stop-loss (SL) and multiple take-profit (TP) levels, along with trade confirmation and "TP Hit" labels. This is critical for practical trading, providing immediate, calculated risk-reward parameters that individual indicators typically don't offer.
This combination is driven by the need for a multi-faceted approach to trading that goes beyond simple signal generation to include trend confirmation, volatility adaptation, and essential risk management.
________________________________________
2. What Problem or Need Does This Mashup Solve?
This mashup addresses several critical gaps that existing individual indicators often fail to fill:
• Reliable Trend Identification in Volatile Markets: While Supertrend is good, it can be late or whipsaw. Integrating Keltner Channels helps it adapt to changing volatility, providing more reliable trend signals.
• Confirmation of Signals: A common pitfall of relying on a single indicator is false signals. "OptionHawk" uses the multi-EMA "Energy" ribbon and the 100-period EMA to confirm the trend identified by the Keltner-Supertrend, reducing false entries.
• Dynamic Support/Resistance & Trend Context: Static support and resistance levels can quickly become irrelevant. The dynamic SMA + ATR trend lines provide continually adjusting zones that reflect the current market's true support and resistance, giving traders a better understanding of price action within the trend.
• Integrated Risk and Reward Management: Most indicators just give entry signals. This script goes a significant step further by automatically calculating and displaying clear stop-loss and up to five take-profit levels (either ATR-based or percentage-based). This is a vital component for structured trading, allowing traders to pre-define their risk and reward for each trade.
• Visual Clarity and Actionable Information: Instead of requiring traders to layer multiple indicators manually, "OptionHawk" integrates them into a single, cohesive display with intuitive bar coloring, shape plots, and informative labels. This reduces cognitive load and presents actionable information directly on the chart.
In essence, "OptionHawk" provides a more comprehensive, adaptive, and actionable trading framework than relying on isolated indicators.
________________________________________
3. How Do the Components Work Together?
The various components of "OptionHawk" interact in a synergistic and often sequential manner to generate signals and manage trades:
• Keltner-Supertrend as the Primary Signal Generator: The supertrend function, enhanced by keltner_channel, is the core of the system. It identifies potential trend reversals and continuation signals (bullish/bearish crosses of the supertrendLine). The sensitivity and factor inputs directly influence how closely the Supertrend follows price and its responsiveness to volatility.
• Multi-EMA "Energy" Ribbon for Momentum and Confirmation: The 15 EMAs (from ema1 to ema15) are plotted to provide a visual representation of short-term momentum. When the price is above these EMAs and they are spread out and pointing upwards, it suggests strong bullish "energy." Conversely, when price is below them and they are pointing downwards, it indicates bearish "energy." This ribbon serves as a simultaneous visual confirmation for the Supertrend signals; a buy signal from Supertrend is stronger if the EMA ribbon is also indicating upward momentum.
• Dynamic Trend Lines for Context and Confirmation: The sma_high and sma_low lines, incorporating ATR, act as dynamic support and resistance. The trend variable, determined by price crossing these lines, provides an overarching directional bias. This component works conditionally with the Supertrend; a bullish Supertrend signal is more potent if the price is also above the sma_high (indicating an uptrend).
• 100-Period Trend Filter EMA for Macro Trend Confirmation: The ema100 acts as a macro trend filter. Supertrend signals are typically considered valid if they align with the direction of the ema100. For example, a "BUY" signal from the Keltner-Supertrend is ideally taken only if the price is also above the ema100, signifying that the smaller trend aligns with the larger trend. This is a conditional filter.
• Trade Confirmation and SL/TP Logic (Sequential and Conditional):
• Once a bull or bear signal is generated by the Keltner-Supertrend, the tradeSignalCall or tradeSignalPut is set to true.
• A confirmation step then occurs for a "BUY" signal, the script checks if the close of the next bar is higher than the entry bar's close. For a "SELL" signal, it checks if the close of the next bar is lower. This is a sequential confirmation step aimed at filtering out weak signals.
• Upon a confirmed signal, the stop-loss (SL) is immediately set based on the previous bar's low (for calls) or high (for puts).
• Multiple take-profit (TP) levels are calculated and stored in arrays. These can be based on a fixed percentage or dynamic ATR multiples, based on user input.
• The TP HIT logic continuously monitors price action simultaneously against these pre-defined target levels, displaying labels when a target is reached. The SL HIT logic similarly monitors for a stop-loss breach.
In summary, the Supertrend generates the initial signal, which is then confirmed by the dynamic trend lines and the 100-period EMA, and visually reinforced by the EMA "Energy" ribbon. The trade management logic then takes over, calculating and displaying vital risk-reward parameters.
________________________________________
4. What is the Purpose of the Mashup Beyond Simply Merging Code?
The purpose of "OptionHawk" extends far beyond merely combining different indicator codes; it's about creating a structured and informed decision-making process for options trading. The key strategic insights and functionalities added by combining these elements are:
• Enhanced Signal Reliability and Reduced Noise: By requiring multiple indicators to align (e.g., Keltner-Supertrend signal confirmed by EMA trend filter and dynamic trend lines), the script aims to filter out false signals and whipsaws that commonly plague individual indicators. This leads to higher-probability trade setups.
• Adaptive Risk Management: The integration of ATR into both the Supertrend calculation and the dynamic stop-loss/take-profit levels makes the entire system adaptive to current market volatility. This means stop-losses and targets are not static but expand or contract with the market's price swings, promoting more realistic risk management.
• Clear Trade Entry and Exit Framework: The script provides a complete trading plan with each signal: a clear entry point, a precise stop-loss, and multiple cascading take-profit levels. This holistic approach empowers traders to manage their trades effectively from initiation to conclusion, rather than just identifying a potential entry.
• Visual Confirmation of Market Strength: The "Energy" ribbon and dynamic trend lines provide an immediate visual understanding of the market's momentum and underlying trend strength, helping traders gauge conviction behind a signal.
• Improved Backtesting and Analysis: By combining these elements into one script, traders can more easily backtest a comprehensive strategy rather than trying to manually combine signals from multiple overlaying indicators, leading to more accurate strategy analysis.
• Suitability for Options Trading: Options contracts are highly sensitive to price movement and volatility. This script's focus on confirmed trend identification, dynamic volatility adaptation, and precise risk management makes it particularly well-suited for the nuanced demands of options trading, where timing and defined risk are paramount.
________________________________________
5. What New Functionality or Insight Does Your Script Offer?
"OptionHawk" offers several new functionalities and insights that significantly enhance decision-making, improve accuracy, and provide clearer signals and better timing for traders:
• "Smart" Supertrend: By basing the Supertrend's volatility component on the Keltner Channel's range instead of a simple ATR, the Supertrend becomes more sensitive to price action within its typical bounds while still adapting to broader market volatility. This can lead to earlier and more relevant trend change signals.
• Multi-Confirmation System: The script doesn't just provide a signal; it layers multiple confirmations (Keltner-Supertrend, multi-EMA "Energy" coloration, dynamic trend lines, and the 100-period EMA). This multi-layered validation significantly improves the accuracy of signals by reducing the likelihood of false positives.
• Automated and Dynamic Risk-Reward Display: This is a major functionality enhancement. The automatic calculation and clear display of stop-loss and five distinct take-profit levels (based on either ATR or percentage) directly on the chart, along with "TP HIT" and "SL HIT" labels, streamline the trading process. Traders no longer need to manually calculate these crucial levels, leading to enhanced decision-making and better risk management.
• Visual Trend "Energy" and Momentum: The vibrant coloring of the multi-EMA ribbon based on price relative to the EMA provides an intuitive and immediate visual cue for market momentum and "energy." This offers an insight into the strength of the current move, which isn't available from single EMA plots.
• Post-Signal Confirmation: The "Confirmation" label appearing on the bar after a signal, if the price continues in the signaled direction, adds an extra layer of real-time validation. This helps to improve signal timing by waiting for initial follow-through.
• Streamlined Options Trading Planning: For options traders, having clear entry prices, stop-losses, and multiple target levels directly annotated on the chart is invaluable. It helps in quickly assessing potential premium movements and managing positions effectively.
In essence, "OptionHawk" transitions from a collection of indicators to a semi-automated trading assistant, providing a comprehensive, visually rich, and dynamically adaptive framework for making more informed and disciplined trading decisions.
----------------------------------------------------------------------------------------------------------------
Performance & Claims
1. What is the claimed performance of the script or strategy?
Answer: The script does not claim any specific performance metrics (e.g., win rate, profit factor, percentage gains). It's an indicator designed to identify potential buy/sell signals and target/stop-loss levels. The labels it generates ("BUY CALL," "BUY PUT," "TP HIT," "SL HIT") are informational based on its internal logic, not a representation of actual trading outcomes.
2. Is there any proof or backtesting to support this claim?
Answer: No, the provided code does not include any backtesting functionality or historical performance proof. As an indicator, it simply overlays visual signals on the chart. To obtain backtesting results, the logic would need to be implemented as a Pine Script strategy with entry/exit rules and commission/slippage considerations.
3. Are there any unrealistic or exaggerated performance expectations being made?
Answer: The script itself does not make any performance expectations. It avoids quantitative claims. However, if this script were presented to users with implied promises of profit based solely on the visual signals, that would be unrealistic.
4. Have you clearly stated the limitations of the performance data (e.g., “based on backtesting only”)?
Answer: There is no statement of performance data or its limitations because the script doesn't generate performance data.
5. Do you include a disclaimer that past results do not guarantee future performance?
Answer: No, the script does not include any disclaimers about past or future performance. This is typically found in accompanying documentation or marketing materials for a trading system, not within the indicator's code itself.
________________________________________
Evidence & Transparency
6. How are your performance results measured (e.g., profit factor, win rate, Sharpe ratio)?
Answer: Performance results are not measured by this script. It's an indicator.
7. Are these results reproducible by others using the same script and settings?
Answer: The visual signals and calculated levels (Supertrend line, EMAs, target/SL levels) generated by the script are reproducible on TradingView when applied to the same instrument, timeframe, and with the same input settings. However, the actual trading results (profit/loss) are not generated or reproducible by this indicator.
8. Do you include enough data (charts, equity curves, trade logs) to support your claims?
Answer: No, the script does not include or generate equity curves or trade logs. It provides visual labels on the chart, which can be seen as a form of "data" to support the signal generation, but not the performance claims (as none are made by the code).
________________________________________
Future Expectations
9. Are you making any predictions about future market performance?
Answer: No, the script does not make any explicit predictions about future market performance. Its signals are based on historical price action and indicator calculations.
10. Have you stated clearly that the future is fundamentally uncertain?
Answer: No, the script does not contain any statements about the uncertainty of the future.
11. Are forward-looking statements presented with caution and appropriate language?
Answer: The script does not contain any forward-looking statements beyond the visual signals it generates based on real-time data.
________________________________________
Risk & Disclosure
12. Have you disclosed the risks associated with using your script or strategy?
Answer: No, the script does not include any risk disclosures. This is typically found in external documentation.
13. Do you explain that trading involves potential loss as well as gain?
Answer: No, the script does not contain any explanation about the potential for loss in trading.
________________________________________
Honesty & Integrity
14. Have you avoided hype words like “guaranteed,” “foolproof,” or “no losses”?
Answer: Yes, the script itself avoids these hype words. The language used within the code is technical and describes the indicator's logic.
15. Is your language grounded and realistic rather than promotional?
Answer: Yes, the language within the provided Pine Script code is grounded and realistic as it pertains to the technical implementation of an indicator.
16. Are you leaving out any important details that might mislead users (e.g., selective performance snapshots)?
Answer: From the perspective of the code itself, no, it's not "leaving out" performance details because it's not designed to generate them. However, if this indicator were to be presented as a "strategy" that implies profitability without accompanying disclaimers, backtesting results, and risk disclosures, then that external presentation could be misleading. The script focuses on signal generation and visual representation.
⚠️ Disclaimer:
This indicator is for informational and educational purposes only. It does not guarantee any future results or performance. All trading involves risk. Please assess your own risk tolerance and consult a licensed financial advisor if needed. Past performance does not indicate future returns.
Profit Guard ProProfitGuard Pro 
ProfitGuard Pro is a risk management and profit calculation tool that helps traders optimize their trades by handling position sizing, risk management, leverage, and take profit calculations. With support for both cumulative and non-cumulative take profit strategies, this versatile indicator provides the insights you need to maximize your trading strategy.
 How to Use ProfitGuard Pro: 
Load the Indicator: Add ProfitGuard Pro to your chart in TradingView.
Set Your Entry Position: Input your desired entry price.
Define Your Stop Loss: Enter the price at which your trade will exit to minimize losses.
Add Take Profit Levels: Input your TP1, TP2, TP3, and TP4 levels, as needed.
If you want fewer take profit levels, adjust the number of TPs in the settings menu. You can choose between 1 to 4 take profit levels based on your strategy.
Adjust Risk Settings: Specify your account size and risk percentage to calculate position size and leverage.
Choose Cumulative or Non-Cumulative Mode: Toggle cumulative profit mode to either recalculate position sizes as each take profit is hit or keep position sizes static for each TP.
Once set up, ProfitGuard Pro will automatically calculate your position size, leverage, and potential profits for each take profit level, providing a clear visual on your chart to guide your trading decisions.
 Key Features: 
Risk Management:
Calculate your risk percentage based on account size and stop loss.
Visualize risk in dollar terms and percentage of your account.
Position Size & Leverage:
Automatically calculate the ideal position size and leverage for your trade based on your entry, stop loss, and risk settings.
Ensure you are trading with the appropriate leverage for your account size.
Cumulative vs Non-Cumulative Profit Mode:
Cumulative Mode: Adjusts position size after each take profit is reached, recalculating for remaining contracts.
Non-Cumulative Mode: Treats each take profit as a separate calculation using the full position size.
Take Profit Levels:
Set up to 4 customizable take profit levels.
Adjust percentage values for each TP target, and visualize them on your chart with easy-to-read lines.
Profit Calculation:
Displays potential profits for each take profit level based on whether cumulative or non-cumulative mode is selected.
Calculate your risk-reward ratio dynamically at each TP.
Customizable Visuals:
Easily customize the table's size, position, and color scheme to fit your chart.
Visualize key trade details like leverage, contracts, margin, and profits directly on your chart.
Short and Long Position Support:
Automatically adjusts calculations based on whether you're trading long or short.
Dskyz (DAFE) Aurora Divergence – Quant Master                            Dskyz (DAFE) Aurora Divergence – Quant Master 
Introducing the  Dskyz (DAFE) Aurora Divergence – Quant Master , a strategy that’s your secret weapon for mastering futures markets like MNQ, NQ, MES, and ES. Born from the legendary Aurora Divergence indicator, this fully automated system transforms raw divergence signals into a quant-grade trading machine, blending precision, risk management, and cyberpunk DAFE visuals that make your charts glow like a neon skyline. Crafted with care and driven by community passion, this strategy stands out in a sea of generic scripts, offering traders a unique edge to outsmart institutional traps and navigate volatile markets.
The Aurora Divergence indicator was a cult favorite for spotting price-OBV divergences with its aqua and fuchsia orbs, but traders craved a system to act on those signals with discipline and automation. This strategy delivers, layering advanced filters (z-score, ATR, multi-timeframe, session), dynamic risk controls (kill switches, adaptive stops/TPs), and a real-time dashboard to turn insights into profits. Whether you’re a newbie dipping into futures or a pro hunting reversals, this strat’s got your back with a beginner guide, alerts, and visuals that make trading feel like a sci-fi mission. Let’s dive into every detail and see why this original DAFE creation is a must-have.
 Why Traders Need This Strategy 
Futures markets are a battlefield—fast-paced, volatile, and riddled with institutional games that can wipe out undisciplined traders. From the April 28, 2025 NQ 1k-point drop to sneaky ES slippage, the stakes are high. Meanwhile, platforms are flooded with unoriginal, low-effort scripts that promise the moon but deliver noise. The Aurora Divergence – Quant Master rises above, offering:
 Unmatched Originality:  A bespoke system built from the ground up, with custom divergence logic, DAFE visuals, and quant filters that set it apart from copycat clutter.
 Automation with Precision:  Executes trades on divergence signals, eliminating emotional slip-ups and ensuring consistency, even in chaotic sessions.
 Quant-Grade Filters:  Z-score, ATR, multi-timeframe, and session checks filter out noise, targeting high-probability reversals.
 Robust Risk Management:  Daily loss and rolling drawdown kill switches, plus ATR-based stops/TPs, protect your capital like a fortress.
 Stunning DAFE Visuals:  Aqua/fuchsia orbs, aurora bands, and a glowing dashboard make signals intuitive and charts a work of art.
 Community-Driven:  Evolved from trader feedback, this strat’s a labor of love, not a recycled knockoff.
Traders need this because it’s a complete, original system that blends accessibility, sophistication, and style. It’s your edge to trade smarter, not harder, in a market full of traps and imitators.
 1. Divergence Detection (Core Signal Logic) 
The strategy’s core is its ability to detect bullish and bearish divergences between price and On-Balance Volume (OBV), pinpointing reversals with surgical accuracy.
 How It Works: 
 Price Slope:  Uses linear regression over a lookback (default: 9 bars) to measure price momentum (priceSlope).
 OBV Slope:  OBV tracks volume flow (+volume if price rises, -volume if falls), with its slope calculated similarly (obvSlope).
 Bullish Divergence:  Price slope negative (falling), OBV slope positive (rising), and price above 50-bar SMA (trend_ma).
 Bearish Divergence:  Price slope positive (rising), OBV slope negative (falling), and price below 50-bar SMA.
 Smoothing:  Requires two consecutive divergence bars (bullDiv2, bearDiv2) to confirm signals, reducing false positives.
 Strength:  Divergence intensity (divStrength = |priceSlope * obvSlope| * sensitivity) is normalized (0–1, divStrengthNorm) for visuals.
 Why It’s Brilliant: 
- Divergences catch hidden momentum shifts, often exploited by institutions, giving you an edge on reversals.
- The 50-bar SMA filter aligns signals with the broader trend, avoiding choppy markets.
- Adjustable lookback (min: 3) and sensitivity (default: 1.0) let you tune for different instruments or timeframes.
 2. Filters for Precision 
Four advanced filters ensure signals are high-probability and market-aligned, cutting through the noise of volatile futures.
 Z-Score Filter: 
 Logic:  Calculates z-score ((close - SMA) / stdev) over a lookback (default: 50 bars). Blocks entries if |z-score| > threshold (default: 1.5) unless disabled (useZFilter = false).
 Impact:  Avoids trades during extreme price moves (e.g., blow-off tops), keeping you in statistically safe zones.
 ATR Percentile Volatility Filter: 
 Logic:  Tracks 14-bar ATR in a 100-bar window (default). Requires current ATR > 80th percentile (percATR) to trade (tradeOk).
 Impact:  Ensures sufficient volatility for meaningful moves, filtering out low-volume chop.
 Multi-Timeframe (HTF) Trend Filter: 
 Logic:  Uses a 50-bar SMA on a higher timeframe (default: 60min). Longs require price > HTF MA (bullTrendOK), shorts < HTF MA (bearTrendOK).
 Impact:  Aligns trades with the bigger trend, reducing counter-trend losses.
 US Session Filter: 
 Logic:  Restricts trading to 9:30am–4:00pm ET (default: enabled, useSession = true) using America/New_York timezone.
 Impact:  Focuses on high-liquidity hours, avoiding overnight spreads and erratic moves.
 Evolution: 
- These filters create a robust signal pipeline, ensuring trades are timed for optimal conditions.
- Customizable inputs (e.g., zThreshold, atrPercentile) let traders adapt to their style without compromising quality.
 3. Risk Management 
The strategy’s risk controls are a masterclass in balancing aggression and safety, protecting capital in volatile markets.
 Daily Loss Kill Switch: 
 Logic:  Tracks daily loss (dayStartEquity - strategy.equity). Halts trading if loss ≥ $300 (default) and enabled (killSwitch = true, killSwitchActive).
Impact: Caps daily downside, crucial during events like April 27, 2025 ES slippage.
 Rolling Drawdown Kill Switch: 
 Logic:  Monitors drawdown (rollingPeak - strategy.equity) over 100 bars (default). Stops trading if > $1000 (rollingKill).
 Impact:  Prevents prolonged losing streaks, preserving capital for better setups.
 Dynamic Stop-Loss and Take-Profit: 
 Logic:  Stops = entry ± ATR * multiplier (default: 1.0x, stopDist). TPs = entry ± ATR * 1.5x (profitDist). Longs: stop below, TP above; shorts: vice versa.
 Impact:  Adapts to volatility, keeping stops tight but realistic, with TPs targeting 1.5:1 reward/risk.
 Max Bars in Trade: 
 Logic:  Closes trades after 8 bars (default) if not already exited.
 Impact:  Frees capital from stagnant trades, maintaining efficiency.
 Kill Switch Buffer Dashboard: 
 Logic:  Shows smallest buffer ($300 - daily loss or $1000 - rolling DD). Displays 0 (red) if kill switch active, else buffer (green).
 Impact:  Real-time risk visibility, letting traders adjust dynamically.
 Why It’s Brilliant: 
- Kill switches and ATR-based exits create a safety net, rare in generic scripts.
- Customizable risk inputs (maxDailyLoss, dynamicStopMult) suit different account sizes.
- Buffer metric empowers disciplined trading, a DAFE signature.
 4. Trade Entry and Exit Logic 
The entry/exit rules are precise, filtered, and adaptive, ensuring trades are deliberate and profitable.
 Entry Conditions: 
 Long Entry:  bullDiv2, cooldown passed (canSignal), ATR filter passed (tradeOk), in US session (inSession), no kill switches (not killSwitchActive, not rollingKill), z-score OK (zOk), HTF trend bullish (bullTrendOK), no existing long (lastDirection != 1, position_size <= 0). Closes shorts first.
 Short Entry:  Same, but for bearDiv2, bearTrendOK, no long (lastDirection != -1, position_size >= 0). Closes longs first.
 Adaptive Cooldown:  Default 2 bars (cooldownBars). Doubles (up to 10) after a losing trade, resets after wins (dynamicCooldown).
 Exit Conditions: 
 Stop-Loss/Take-Profit:  Set per trade (ATR-based). Exits on stop/TP hits.
 Other Exits:  Closes if maxBarsInTrade reached, ATR filter fails, or kill switch activates.
 Position Management:  Ensures no conflicting positions, closing opposites before new entries.
 Built To Be Reliable and Consistent: 
- Multi-filtered entries minimize false signals, a stark contrast to basic scripts.
- Adaptive cooldown prevents overtrading, especially after losses.
- Clean position handling ensures smooth execution, even in fast markets.
 5. DAFE Visuals 
The visuals are a DAFE hallmark, blending function with clean flair to make signals intuitive and charts stunning.
 Aurora Bands: 
 Display:  Bands around price during divergences (bullish: below low, bearish: above high), sized by ATR * bandwidth (default: 0.5).
 Colors:  Aqua (bullish), fuchsia (bearish), with transparency tied to divStrengthNorm.
 Purpose:  Highlights divergence zones with a glowing, futuristic vibe.
 Divergence Orbs: 
 Display:  Large/small circles (aqua below for bullish, fuchsia above for bearish) when bullDiv2/bearDiv2 and canSignal. Labels show strength (0–1).
 Purpose:  Pinpoints entries with eye-catching clarity.
 Gradient Background: 
 Display:  Green (bullish), red (bearish), or gray (neutral), 90–95% transparent.
 Purpose:  Sets the market mood without clutter.
 Strategy Plots: 
- Stop/TP Lines: Red (stops), green (TPs) for active trades.
- HTF MA: Yellow line for trend context.
- Z-Score: Blue step-line (if enabled).
- Kill Switch Warning: Red background flash when active.
 What Makes This Next-Level?: 
- Visuals make complex signals (divergences, filters) instantly clear, even for beginners.
- DAFE’s unique aesthetic (orbs, bands) sets it apart from generic scripts, reinforcing originality.
- Functional plots (stops, TPs) enhance trade management.
 6. Metrics Dashboard 
The top-right dashboard (2x8 table) is your command center, delivering real-time insights.
 Metrics: 
 Daily Loss ($):  Current loss vs. day’s start, red if > $300.
 Rolling DD ($):  Drawdown vs. 100-bar peak, red if > $1000.
 ATR Threshold:  Current percATR, green if ATR exceeds, red if not.
 Z-Score:  Current value, green if within threshold, red if not.
 Signal:  “Bullish Div” (aqua), “Bearish Div” (fuchsia), or “None” (gray).
 Action:  “Consider Buying”/“Consider Selling” (signal color) or “Wait” (gray).
 Kill Switch Buffer ($):  Smallest buffer to kill switch, green if > 0, red if 0.
Why This Is Important?:
- Consolidates critical data, making decisions effortless.
- Color-coded metrics guide beginners (e.g., green action = go).
- Buffer metric adds transparency, rare in off-the-shelf scripts.
 7. Beginner Guide 
 Beginner Guide:  Middle-right table (shown once on chart load), explains aqua orbs (bullish, buy) and fuchsia orbs (bearish, sell).
 Key Features: 
 Futures-Optimized:  Tailored for MNQ, NQ, MES, ES with point-value adjustments.
 Highly Customizable:  Inputs for lookback, sensitivity, filters, and risk settings.
 Real-Time Insights:  Dashboard and visuals update every bar.
 Backtest-Ready:  Fixed qty and tick calc for accurate historical testing.
 User-Friendly:  Guide, visuals, and dashboard make it accessible yet powerful.
 Original Design:  DAFE’s unique logic and visuals stand out from generic scripts.
 How to Use 
 Add to Chart:  Load on a 5min MNQ/ES chart in TradingView.
 Configure Inputs:  Adjust instrument, filters, or risk (defaults optimized for MNQ).
 Monitor Dashboard:  Watch signals, actions, and risk metrics (top-right).
 Backtest:  Run in strategy tester to evaluate performance.
 Live Trade:  Connect to a broker (e.g., Tradovate) for automation. Watch for slippage (e.g., April 27, 2025 ES issues).
 Replay Test:  Use bar replay (e.g., April 28, 2025 NQ drop) to test volatility handling.
 Disclaimer 
Trading futures involves significant risk of loss and is not suitable for all investors. Past performance is not indicative of future results. Backtest results may not reflect live trading due to slippage, fees, or market conditions. Use this strategy at your own risk, and consult a financial advisor before trading. Dskyz (DAFE) Trading Systems is not responsible for any losses incurred.
Backtesting:
Frame: 2023-09-20 - 2025-04-29
Fee	Typical Range (per side, per contract)
CME Exchange	$1.14 – $1.20
Clearing	$0.10 – $0.30
NFA Regulatory	$0.02
Firm/Broker Commis.	$0.25 – $0.80 (retail prop)
TOTAL	$1.60 – $2.30 per side
Round Turn: (enter+exit) = $3.20 – $4.60 per contract
 Final Notes 
 The Dskyz (DAFE) Aurora Divergence – Quant Master  isn’t just a strategy—it’s a movement. Crafted with originality and driven by community passion, it rises above the flood of generic scripts to deliver a system that’s as powerful as it is beautiful. With its quant-grade logic, DAFE visuals, and robust risk controls, it empowers traders to tackle futures with confidence and style. Join the DAFE crew, light up your charts, and let’s outsmart the markets together!
(This publishing will most likely be taken down do to some miscellaneous rule about properly displaying charting symbols, or whatever. Once I've identified what part of the publishing they want to pick on, I'll adjust and repost.)
Use it with discipline. Use it with clarity. Trade smarter.
**I will continue to release incredible strategies and indicators until I turn this into a brand or until someone offers me a contract.
Created by Dskyz, powered by DAFE Trading Systems. Trade fast, trade bold.
FVG Visual Trading ToolHow to Use the FVG Tool 
1. Identify the FVG Zone
Bullish FVG: Look for green boxes that represent potential support zones. These are areas where price is likely to retrace before continuing upward.
Bearish FVG: Look for red boxes that represent potential resistance zones. These are areas where price is likely to retrace before continuing downward.
2. Set Up Your Trade
Entry: Place a limit order at the retracement zone (inside the FVG box). This ensures you enter the trade when the price retraces into the imbalance.
Stop-Loss (SL): Place your stop-loss just below the FVG box for bullish trades or just above the FVG box for bearish trades. The tool provides a suggested SL level.
Take-Profit (TP): Set your take-profit level at a 2:1 risk-reward ratio (or higher). The tool provides a suggested target level.
3. Let the Trade Run
Once your trade is set up, let it play out. Avoid micromanaging the trade unless market conditions change drastically.
 Step-by-Step Example 
 Bullish FVG Trade 
Identify the FVG:
A green box appears, indicating a bullish FVG.
The tool provides the target price (e.g., 0.6371) and the stop-loss level (e.g., 0.6339).
Set Up the Trade:
Place a limit buy order at the retracement zone (inside the green box).
Set your stop-loss just below the FVG box (e.g., 0.6339).
Set your take-profit at a 2:1 risk-reward ratio or the suggested target (e.g., 0.6371).
Monitor the Trade:
Wait for the price to retrace into the FVG zone and trigger your limit order.
Let the trade run until it hits the take-profit or stop-loss.
 Bearish FVG Trade 
Identify the FVG:
A red box appears, indicating a bearish FVG.
The tool provides the target price and the stop-loss level.
Set Up the Trade:
Place a limit sell order at the retracement zone (inside the red box).
Set your stop-loss just above the FVG box.
Set your take-profit at a 2:1 risk-reward ratio or the suggested target.
Monitor the Trade:
Wait for the price to retrace into the FVG zone and trigger your limit order.
Let the trade run until it hits the take-profit or stop-loss.
Key Features of the Tool in Action
 Visual Clarity: 
The green and red boxes clearly show the FVG zones, making it easy to identify potential trade setups.
Labels provide the target price and stop-loss level for quick decision-making.
Risk-Reward Management:
The tool encourages disciplined trading by providing predefined SL and TP levels.
A 2:1 risk-reward ratio ensures that profitable trades outweigh losses.
 Hands-Off Execution: 
By placing limit orders, you can let the trade execute automatically without needing to monitor the market constantly.
Best Practices
Trade in the Direction of the Trend:
Use higher timeframes (e.g., 4-hour or daily) to identify the overall trend.
Focus on bullish FVGs in an uptrend and bearish FVGs in a downtrend.
Combine with Confirmation Signals:
Look for additional confirmation, such as candlestick patterns (e.g., engulfing candles) or indicator signals (e.g., RSI, MACD).
Adjust Parameters for Volatility:
For highly volatile markets, consider increasing the stop-loss percentage to avoid being stopped out prematurely.
Avoid Overtrading:
Not every FVG is a good trading opportunity. Be selective and only trade setups that align with your strategy.
Backtest and Optimize:
Use historical data to test the tool and refine your approach before trading live.
Common Mistakes to Avoid
Entering Without Confirmation:
Wait for price to retrace into the FVG zone before entering a trade.
Avoid chasing trades that have already moved away from the zone.
Ignoring Risk Management:
Always use a stop-loss to protect your account.
Stick to a consistent risk-reward ratio.
Trading Against the Trend:
Avoid taking trades that go against the prevailing market trend unless there is strong evidence of a reversal.
 Final Thoughts 
The FVG Visual Trading Tool is a powerful aid for identifying high-probability trade setups. By following the steps outlined above, you can use the tool to trade with confidence and discipline. Remember, no tool guarantees success, so always combine it with sound trading principles and proper risk management
Pivot Points [SMRT Algo]Pivot Points   is a free, innovative indicator designed to automatically detect and highlight key turning points on your TradingView charts through advanced candlestick pattern analysis. This indicator is perfect for traders seeking clear visual signals for potential trend reversals.
  
 How It Works: 
 
  Candlestick Pattern Analysis: The indicator continuously scans for specific candlestick formations. It identifies a potential high pivot when a bullish candle (where the close is higher than the open) is immediately followed by a bearish candle (where the close is lower than the open). Conversely, a potential low pivot is detected when a bearish candle is followed by a bullish candle.
  Boxing the Price Range: Once a potential pivot is identified, the algorithm draws a box around the corresponding price range. This box captures the area where the price action is concentrated, serving as a zone of interest for the pivot.
  Confirmation of Major Pivots: The initial detection marks what we call a "minor pivot" with a temporary yellow box. The indicator then waits for subsequent price action. If the price fails to break out of this box—meaning it remains confined within the defined boundaries—the pivot is confirmed as a major pivot. At this stage, the yellow box changes color to green (or red, depending on whether it’s a high or low pivot), clearly marking the confirmed turning point.
  Pivot Sequence: The progression follows a clear sequence: Minor Pivot ➔ Yellow Box ➔ Major Pivot. This step-by-step visual guide helps traders quickly interpret the strength and significance of the pivot.
 
  
 Inputs: 
 
  Show Labels: An input option allows you to toggle pivot labels on or off, so you can choose whether to display descriptive labels directly on your chart.
  Adjustable Colors: The colors of the pivot points—including the green and red boxes—are fully customizable via the input settings. This ensures that you can tailor the visual appearance of the indicator to match your personal charting style or trading strategy.
 
  
 Enhancing Entry and Exit Strategies 
 
  Entry Points: Look to enter a trade when the indicator confirms a pivot (after the box changes color). A confirmed pivot could indicate that a reversal is underway, giving you a potential entry signal.
  Exit Points & Stop Losses: Use the boundaries of the pivot box to set stop losses. For example, if you’re in a long trade and the price approaches a confirmed resistance pivot, consider this a signal to tighten stops or exit, as the trend may reverse.
  Confluence with Other Indicators: Combine the pivot point signals with other tools like RSI, MACD, or volume indicators. If multiple signals point to a reversal at the same pivot, it strengthens your confidence in the trade decision.
 
 Trading Strategy Applications 
 
  Reversal Trading: Use confirmed pivot points as indicators for potential reversals. Enter trades when the price action validates the pivot point, anticipating that the market is turning.
  Range Trading: When the price oscillates within a defined pivot box, you can use the top and bottom of the box as potential boundaries for a range-trading strategy.
  Breakout Trading: Conversely, if the price breaks out of a pivot box, this may signal the start of a new trend. You can use this breakout as a trigger for entering a position in the direction of the breakout.
 
The indicator highlights potential reversal zones with clearly marked boxes and labels, making it easier to spot key turning points and manage trades effectively.
Pivot Points   removes the guesswork by automatically scanning for and confirming pivot points based on rigorous candlestick analysis. 
Whether you're a day trader or a swing trader, Pivot Points   provides actionable insights into market dynamics, helping you to better time entries and exits.
  [3Commas] DCA Bot TesterDCA Bot Tester  
 🔷What it does:  A tool designed to simulate the behavior of a Dollar Cost Averaging (DCA) strategy based on input signals from a source indicator. Additionally, it enables you to send activation signals to 3Commas Bots via TradingView webhooks.
 🔷Who is it for:  This tool is ideal for those who want a visual representation and strategy report of how a DCA Bot would perform under specific conditions. By adjusting the parameters, you can assess whether the strategy aligns with your risk/reward expectations before implementation, helping you save time and protect your capital.
 🔷How does it work:  The tool leverages a pyramiding function to simulate price averaging, mimicking how a DCA Bot operates. It calculates volume-based averaging and, upon reaching the target, closes the positions. Conversely, if the target isn't reached, a Stop Loss is triggered, potentially resulting in significant losses if improperly configured.
 🔷Why It’s Unique  
 
 Easy visualization of DCA Bot entry and exit points according to user preferences.
 DCA Bot Summary table same as the one shown in the new 3Commas interface.
 Use plots from other indicators as Entry Trigger Source, with a small modification of the code.
 Option to Review message format before sending Signals to 3Commas. Compatibility with Multi-Pair, and futures contract pairs.
 Option to filter signals by session and day according to the user’s timezone.
 
👉 Before continuing with the explanation of the tool, please take a few minutes to read this information,  paying special attention to the risks  of using DCA strategies.
 DCA Bot: What is it, how does it work, and what are its advantages and risks? 
A  DCA Bot  is an automated tool designed to simplify and optimize your trading operations, particularly in cryptocurrencies. Based on the concept of  Dollar Cost Averaging (DCA) , this bot implements scaled strategies that allow you to distribute your investments intelligently. The key lies in dividing your capital into multiple orders, known as base orders and safety orders, which are executed at different price levels depending on market conditions.
These bots are highly customizable, meaning you can adapt them to your goals and trading style, whether you're operating  Long  (expecting a price increase) or  Short  (expecting a price decrease). Their primary purpose is to reduce the impact of entries that move against the estimated direction and ensure you achieve a more favorable average price.
🔸 Key Features of DCA Bots 
 
 Customizable configuration:  DCA bots allow you to adjust the size of your initial investment, the number of safety orders, and the price levels at which these orders execute. These orders can be equal or incremental, depending on your risk tolerance.  
 Scaled safety orders:  If the asset's price moves against your position, the bot executes safety orders at strategic levels to average your entry price and increase your chances of closing in profit.  
 Automatic Take Profit:  When the predefined profit level is reached, the bot closes the position, ensuring net gains by averaging all entries made using the DCA strategy.  
 Stop Loss option:  To protect your capital, you can set a stop loss level that limits losses if the market moves drastically against your position.  
 Flexibility:  Bots can integrate with 3Commas technical indicators or external signals from TradingView, allowing you to trade in any trend, whether bullish or bearish.  
 Support for multiple assets:  You can trade cryptocurrency pairs and exchanges compatible with 3Commas, offering a wide range of possibilities to diversify your strategies.
 
✅ Advantages of DCA Bots 
 
 Time-saving automation:  DCA bots eliminate the need for constant market monitoring, executing your trades automatically and efficiently based on predefined settings.  
 Favorable averages in volatile markets:  By averaging your entries, the bot can offer more competitive prices even under adverse market conditions. This increases your chances of recovering a position and closing it profitably.  
 Advanced capital management:  With customizable settings, you can adjust the size of base and safety orders to optimize capital usage and reduce risk.  
 Additional protection:  The ability to set a stop loss ensures your losses are limited, safeguarding your capital in extreme scenarios.  
 
⚠️ Risks of Using a DCA Bot 
 
 Requires significant capital:  Safety orders can accumulate quickly if the price moves against your position. This issue is compounded if increasing amounts are used for safety orders, which can immobilize large portions of capital in adverse markets.  
 Markets lacking clear direction:  During consolidation periods or erratic movements, the bot may generate unrealized losses and make position recovery difficult.  
 Opportunity cost:  Investing in an asset that doesn't show favorable behavior can prevent you from seizing opportunities in other markets.  
 Emotional pressure:  Large investments in advanced stages of the DCA strategy can cause stress, especially if an asset takes too long to reach your take profit level.  
 Dependence on market recovery:  DCA assumes that the price will eventually move in your favor, which does not always happen, especially in assets without solid fundamentals.  
 
📖 Key Considerations for Effectively Using a DCA Bot 
 
 Use small amounts for your base and safety orders:  Setting small initial orders not only limits capital usage but also allows you to manage multiple bots simultaneously, maximizing portfolio diversification.  
 Capital management:  Define a clear budget and never risk more than you are willing to lose. This is essential for maintaining sustainable operations.  
 Select assets with strong fundamentals:  Apply DCA to assets you understand and that have solid fundamentals and a proven historical growth record. Additionally, analyze each cryptocurrency's fundamentals: What problem does it solve? Does it have a clear use case? Is it viable in the long term? These questions will help you make more informed decisions.  
 Diversification:  Do not concentrate all your capital on a single asset or strategy. Spread your risk across multiple bots or assets.  
 Monitor regularly:  While bots are automated and eliminate the need to monitor the market constantly, it is essential to monitor the bots themselves to ensure they are performing as expected. This includes reviewing their performance and making adjustments if market conditions change. Remember, the goal is to automate trades, but active bot management is crucial to avoid surprises.  
 
A  DCA Bot  is a powerful tool for traders looking to automate their strategies and reduce the impact of market fluctuations. However, like any tool, its success depends on how it is configured and used. By applying solid capital management principles, carefully selecting assets, and using small amounts in your orders, you can maximize its potential and minimize risks.  
 🔷FEATURES & HOW TO USE 
 🔸Strategy:  Here you must select the type of signal you are going to analyze and send signals to the DCA Bot, either Long for buy signals or Short for sell signals. This must match the Bot created in 3Commas.
 🔸Add a Source Indicator for Entry Triggers 
 Tradingview allows us to use indicator plots as a source in other indicators, we will use this functionality so that the buy or sell signals of an indicator are processed by the DCA Bot Tester. 
In this  EXAMPLE  we will use a simple strategy that uses a Donchian Channel (DC) and an Exponential Moving Average (EMA).
 
 Trigger to buy or long signal will be when: the price closes above the previous upper level and the average of the upper and lower level (basis) is greater than the EMA.
 Trigger sell or short signal will be when: the price closes below the previous lower level and the average of the upper and lower level (basis) is less than the EMA.
 
 
trigger_buy  = ta.crossover (close,upper ) and basis > ema and barstate.isconfirmed
trigger_sell = ta.crossunder(close,lower ) and basis < ema and barstate.isconfirmed
 
Then we create the plots that will be used as input source in the DCA Bot Tester indicator. 
 
 When a buy condition is given the plot  "🟢 Trigger Buy"  will have a value of 1 otherwise it will remain at 0.
 When a sell condition is given the plot  "🔴 Trigger Sell"  will have a value of -1 otherwise it will remain at 0.
 
 
plot(trigger_buy ?  1 : 0 , '🟢 Trigger Buy' , color = na, display = display.data_window)
plot(trigger_sell? -1 : 0 , '🔴 Trigger Sell', color = na, display = display.data_window)
 
Here you have the complete code so you can use it and do tests. Basically you just have to define the buy or sell conditions of your preferred indicator or strategy and then create the plots with the same format that will be used in DCA Bot Tester.
 
//@version=6
indicator(title="Simple Strategy Example", overlay= false)
// Indicator and Signal Triggers
length        = input.int(10, title = "DC Length" , display = display.none)
length_ema    = input.int(50, title = "EMA Length", display = display.none)
lower = ta.lowest (length)
upper = ta.highest(length)
ema   = ta.ema    (close, length_ema)
basis = math.avg  (upper, lower)
plot(basis, "Basis", color = color.orange, display = display.all-display.status_line)
plot(upper, "Upper", color = color.blue  , display = display.all-display.status_line)
plot(lower, "Lower", color = color.blue  , display = display.all-display.status_line)
plot(ema  , "EMA"  , color = color.red   , display = display.all-display.status_line)
candlecol = open < close ? color.teal : color.red
plotcandle(open, high, low, close, title='Candles', color = candlecol, wickcolor = candlecol, bordercolor = candlecol, display = display.pane)
trigger_buy  = ta.crossover (close,upper ) and basis > ema and barstate.isconfirmed
trigger_sell = ta.crossunder(close,lower ) and basis < ema and barstate.isconfirmed
plotshape(trigger_buy ?close:na, title="Label Buy" , style=shape.labelup  , location= location.belowbar, color=color.green, text="B", textcolor=color.white, display=display.pane)
plotshape(trigger_sell?close:na, title="Label Sell", style=shape.labeldown, location= location.abovebar, color=color.red  , text="S", textcolor=color.white, display=display.pane)
// ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
// 👇 Plots to be used in the DCA Bot Indicator as source triggers.
// ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
plot(trigger_buy ?  1 : 0 , '🟢 Trigger Buy' , color = na, display = display.data_window)
plot(trigger_sell? -1 : 0 , '🔴 Trigger Sell', color = na, display = display.data_window)
 
 To use the example code 
 
 Open the Pine Editor, paste the code and then click Add to chart. 
 Then in the Plot Entry Trigger Source option, we will select 🟢 Trigger Buy, as the plot that will give us the buy signals when it is worth 1, otherwise for the sell signals you must change the value to -1 in the Plot Entry Trigger Value and remember to change the strategy mode to Short.
 
 🔸DCA Settings:  Here you need to configure the DCA values of the strategy, you can see the meaning of each value in the Settings Section. Once you are satisfied with the tests configure the 3Commas DCA Bot with the same values so that the Summary Table matches the 3Commas Table. Pay close attention to the Total Volume that the Bot will use, according to the amount of Safety Orders you are going to execute, and that all the values in the table adapt to your risk tolerance. 
 🔸DCA Bot Deal Start:  Once you create the Bot in 3Commas with the same settings it will give you a Deal Start Message, you must copy and paste it in this section, verify that it is the same in the summary table, this is used to be sent through tradingview alerts to the Bot and it can process the signals. 
 🔸DCA Bot Multi-Pair:  A Multi-Pair Bot allows you to manage several pairs with a single bot, but you must specify which pair it will run on. You must activate it if you want to use the signals in a DCA Bot Multi-pair. In the text box you must enter (using the 3Commas format) the symbol for each pair before you create the alert so that the bot understands which pair to work on.
In the following image we would be configuring the indicator to send a signal to activate the bot in the BTCUSDT pair using the given format it would be USDT_BTC, but if we wanted to send a signal in another pair we must change the pair in the chart and also in the configuration, an example with ETHUSDT would be USDT_ETH. After this we could create the alert, and the Mult-Pair Bot would detect it correctly. 
 🔸Strategy Tester Filters:  This is useful if you want to test the strategy's result on a certain time window, the indicator will only enter this range. If disabled it will use all historical data available on the chart. If you are going to use the tool to send signals, make sure to disable the Use Custom Test Period. If you want the entries to only run at a certain time and day, in that case make sure that the timezone matches the one you are using in the chart. 
 🔸Properties:  Adjust your initial capital and exchange commission appropriately to achieve realistic results. 
 🔸Create alerts to trigger the DCA Bot   
 
 Check that the message is the same as the one indicated by the DCA Bot.
 In the case of Multi-Pair, enable the option to add the symbol with the correct format.
 When creating an alert, select Any alert() function call.                 
 Enter the any name of the alert.                                         
 Open the Notifications tab and enable Webhook URL                        
 Paste Webhook URL provided by 3Commas looking in the section How to use TradingView custom signals.
 Done, alerts will be sent with the correct format automatically to 3Commas.
 
 🔷 INDICATOR SETTINGS 
 🔸3Commas DCA Bot Settings 
 
 Strategy: Select the direction of the strategy to test Long or Short, this must be the same as the Bot created in 3Commas, so that the signals are processed properly.
 DCA Bot Deal Start: Copy and paste the message for the deal start signal of the DCA Bot you created in 3Commas. This is the message that will be sent with the alert to the Bot, you must verify that it is the same as the 3Commas bot so that it can process properly so that it executes and starts the trade.
 DCA Bot Multi-Pair: A Multi-Pair Bot allows you to manage several pairs with a single bot, but you must specify which pair it will run on.
 DCA Bot Summary Table: Here you can activate the display of table as well as change the size, position, text color and background color.
 
 🔸Source Indicator Settings 
 
 Plot Entry Trigger Source: Select a Plot for Entries of the Source Indicator. This refers to the Long or Short entry signal that the indicator will use as BO (Base Order).
 Plot Entry Trigger Value: Value of the Source Indicator to Deal Start Condition Trigger. The default value is 1, this means that when a signal is given for example Long in the source indicator, we will use 1 or for Short -1 if there is no signal it will be 0 so it will not execute any entry, please review the example code and adjust the indicator you are going to use in the same way.
 
 🔸DCA Settings 
 
 Base Order: The Base Order is the first order the bot will create when starting a new deal.
 Safety Order: Enter the amount of funds your safety orders will use to average the cost of the asset being traded.Safety orders are also known as Dollar Cost Averaging and help when prices move in the opposite direction to your bot's take profit target.
 Safety Orders Deviation %: Enter the percentage difference in price to create the first Safety Order. All Safety Orders are calculated from the price the initial Base Order was filled on the exchange account.
 Safety Orders Max Count: This is the total number of Safety Orders the bot is allowed to use per deal that is opened. All Safety Orders created by the bot are placed as Limit Orders on the exchange's order book.
 Safety Orders Volume Scale: The Safety Order Volume Scale is used to multiply the amount of funds used by the last Safety Order that was created. Using a larger amount of funds for Safety Orders allows your bot to be more aggressive at Dollar Cost Averaging the price of the asset being traded. 
 Safety Orders Step Scale: The Safety Order Step Scale is used to multiply the Price Deviation percentage used by the last Safety Order placed on the exchange account. Using a larger value here will reduce the amount of Safety Orders your bot will require to cover a larger move in price in the opposite direction to the active deal's take profit target.
 Take Profit %: The Take Profit section offers tools for flexible management of target parameters: automatic profit upon reaching one or more target levels in percentage.
 Stop Loss % | Use SL: To enable Stop Loss, please check the "Use SL" box. This is the percentage that price needs to move in the opposite direction to close the deal at a loss. This must be greater than the sum of the deviations from the safety orders.
 
 🔸Strategy Tester Filters 
 
 Use Custom Test Period: When enabled signals only works in the selected time window.. If disabled it will use all historical data available on the chart.
 Test Start and End: Once the Custom Test Period is enabled, here you select the start and end date that you want to analyze.
 Session Filter | Days | Background: Here you can choose a time zone in which signals will be sent or your strategy will be tested, as well as the days and a background of it. It is important that you use the same timezone as your chart so that it matches.
 
👨🏻💻💭 If this tool helps you, don’t forget to give it a boost! Feel free to share in the comments how you're using it or if you have any questions.
_________________________________________________________________ 
 The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
Velocity/Volatility/Volume StrategyThe "Vel/Vty/Vol Strategy" is a momentum-based trading approach designed to take advantage of strong price movements that are confirmed by both volatility and volume (if enabled). It provides a high level of customization, allowing traders to adjust various settings based on market conditions and individual preferences. By combining three critical indicators—velocity, volatility (measured through Bollinger Band Width), and an optional volume filter—the strategy generates trade signals for both long and short positions. Here’s a comprehensive explanation of how the strategy works, how the parameters can be customized, and how those adjustments benefit users.
At its core, the strategy focuses on velocity, which measures the speed at which price is changing over time. This is a key indicator of momentum, with a "StrongUp" signal indicating bullish momentum and a "StrongDown" signal suggesting bearish momentum. In addition to velocity, the strategy factors in acceleration, which helps gauge whether momentum is building or weakening. The second essential component is Bollinger Band Width (BBW), which measures volatility in the market. When the BBW expands, it signals increasing volatility, a condition that must be met in combination with a velocity signal to generate a trade. Lastly, the strategy includes an optional Volume Oscillator to filter trades. When this volume filter is enabled, trades will only be executed if there’s an increase in volume, further validating market activity.
The strategy generates long and short trade signals based on specific conditions. A long trade is triggered when there is a strong upward velocity, accompanied by an increase in Bollinger Band Width, indicating both momentum and heightened volatility. If the volume filter is toggled on, a rise in volume must also confirm the signal. Similarly, a short trade is initiated when a strong downward velocity is detected, again paired with an increase in volatility and, optionally, a volume rise. This ensures that trades occur during periods of heightened market activity, reducing the likelihood of false signals.
To help manage risk, the strategy includes several customizable tools. Users can set take profit levels to automatically close positions and lock in gains once a predefined profit percentage is reached. For example, if a 2% take profit is set, a long position will be closed once the price has risen by 2%. Additionally, a trailing take profit option can be enabled, allowing the strategy to dynamically adjust the take-profit target as the market moves in the user’s favor. This ensures that profits are locked in as long as the market continues to trend positively, while providing protection in case of a reversal. The strategy also includes a trailing stop-loss feature, which adjusts the stop price as the market moves in favor of the trade, helping to minimize losses and protect gains.
The strategy offers a variety of parameters that can be customized to suit different trading styles and market conditions. The velocity lookback period controls how far back the strategy looks to calculate velocity. A shorter lookback makes the strategy more sensitive to recent price changes, generating more signals, which can benefit day traders or those seeking to capture short-term price swings. Conversely, a longer lookback smooths out the velocity calculation, reducing false signals and making the strategy more suitable for traders seeking to capture larger trends. Similarly, the Bollinger Band Width (BBW) length can be adjusted to control how far back the strategy looks to calculate volatility. A shorter BBW length makes the strategy more sensitive to volatility spikes, useful in rapidly changing markets. In contrast, a longer BBW length filters out short-term noise and focuses on more sustainable volatility shifts, better suited for slower, more stable markets.
The volume filter is another powerful feature that can be toggled on or off. When turned on, the strategy will only execute trades if there is an increase in volume alongside velocity and volatility signals. This helps filter out false signals in low-volume markets, ensuring that price movements are supported by actual market activity. If the volume filter is turned off, the strategy focuses purely on price and volatility changes, which can be useful in markets where volume data is unreliable or less relevant.
The take profit percentage can be adjusted to define how aggressively or conservatively profits are locked in. A lower take profit percentage allows traders to capture smaller, quicker profits, which can be advantageous in volatile markets. A higher take profit percentage suits traders who prefer to capture larger moves, allowing them to stay in trades longer to benefit from extended trends. Similarly, the trailing take profit percentage determines how tightly the strategy follows market prices as they move in favor of the trade. A tighter trailing percentage ensures that profits are locked in quickly, while a wider trailing percentage gives trades more room to run, ideal for capturing large trends.
The stop loss percentage is another key setting that controls how much risk a trader is willing to take before the position is closed. A tighter stop loss minimizes losses but may result in more frequent stop-outs, particularly in volatile markets. A wider stop loss provides more room for trades to develop, which is useful for traders aiming to capture longer trends despite short-term fluctuations. Additionally, the velocity thresholds can be adjusted to set how sensitive the strategy is to price movements. Lower thresholds increase sensitivity, generating more signals in fast-moving markets, while higher thresholds filter out weaker signals, focusing on larger momentum shifts.
The strategy also allows users to define a time range during which it is active, offering flexibility in backtesting and optimizing for specific market conditions. By limiting the strategy to certain periods, users can tailor it to seasonal trends or historical data that matches their current trading environment.
The flexibility of this strategy makes it suitable for a wide range of traders. Day traders can benefit from adjusting the velocity and BBW lookback periods, tightening take profit and stop loss settings to capture short, fast price movements in highly volatile markets. Trend traders can lengthen the lookback periods and widen the velocity thresholds to capture larger, sustained moves while riding out short-term volatility. Traders with a lower risk tolerance can enable the volume filter and tighten stop losses to reduce false signals and minimize losses. On the other hand, aggressive traders can widen the take profit and trailing stop percentages to allow trades to develop fully, maximizing potential gains in trending markets.
RSI Trend Following StrategyOverview 
The RSI Trend Following Strategy utilizes Relative Strength Index (RSI) to enter the trade for the potential trend continuation. It uses Stochastic indicator to check is the price is not in overbought territory and the MACD to measure the current price momentum. Moreover, it uses the 200-period EMA to filter the counter trend trades with the higher probability. The strategy opens only long trades.
 Unique Features 
 
 Dynamic stop-loss system:  Instead of fixed stop-loss level strategy utilizes average true range (ATR) multiplied by user given number subtracted from the position entry price as a dynamic stop loss level.
 Configurable Trading Periods:  Users can tailor the strategy to specific market windows, adapting to different market conditions.
 Two layers trade filtering system:  Strategy utilizes MACD and Stochastic indicators measure the current momentum and overbought condition and use 200-period EMA to filter trades against major trend.
 Trailing take profit level:  After reaching the trailing profit activation level script activates the trailing of long trade using EMA. More information in methodology.
 Wide opportunities for strategy optimization:  Flexible strategy settings allows users to optimize the strategy entries and exits for chosen trading pair and time frame.
 
 Methodology 
The strategy opens long trade when the following price met the conditions:
 
 RSI is above 50 level.
 MACD line shall be above the signal line
 Both lines of Stochastic shall be not higher than 80 (overbought territory)
 Candle’s low shall be above the 200 period EMA
 
When long trade is executed, strategy set the stop-loss level at the price ATR multiplied by user-given value below the entry price. This level is recalculated on every next candle close, adjusting to the current market volatility.
At the same time strategy set up the trailing stop validation level. When the price crosses the level equals entry price plus ATR multiplied by user-given value script starts to trail the price with trailing EMA(by default = 20 period). If price closes below EMA long trade is closed. When the trailing starts, script prints the label “Trailing Activated”.
 Strategy settings 
In the inputs window user can setup the following strategy settings:
 
 ATR Stop Loss  (by default = 1.75)
 ATR Trailing Profit Activation Level  (by default = 2.25)
 MACD Fast Length  (by default = 12, period of averaging fast MACD line)
 MACD Fast Length  (by default = 26, period of averaging slow MACD line)
 MACD Signal Smoothing  (by default = 9, period of smoothing MACD signal line)
 Oscillator MA Type  (by default = EMA, available options: SMA, EMA)
 Signal Line MA Type  (by default = EMA, available options: SMA, EMA)
 RSI Length  (by default = 14, period for RSI calculation)
 Trailing EMA Length  (by default = 20, period for EMA, which shall be broken close the trade after trailing profit activation)
 
 Justification of Methodology 
This trading strategy is designed to leverage a combination of technical indicators—Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), Stochastic Oscillator, and the 200-period Exponential Moving Average (EMA)—to determine optimal entry points for long trades. Additionally, the strategy uses the Average True Range (ATR) for dynamic risk management to adapt to varying market conditions. Let's look in details for which purpose each indicator is used for and why it is used in this combination. 
 Relative Strength Index (RSI)  is a momentum indicator used in technical analysis to measure the speed and change of price movements in a financial market. It helps traders identify whether an asset is potentially overbought (overvalued) or oversold (undervalued), which can indicate a potential reversal or continuation of the current trend. 
How RSI Works? RSI tracks the strength of recent price changes. It compares the average gains and losses over a specific period (usually 14 periods) to assess the momentum of an asset. Average gain is the average of all positive price changes over the chosen period. It reflects how much the price has typically increased during upward movements. Average loss is the average of all negative price changes over the same period. It reflects how much the price has typically decreased during downward movements.
RSI calculates these average gains and losses and compares them to create a value between 0 and 100. If the RSI value is above 70, the asset is generally considered overbought, meaning it might be due for a price correction or reversal downward. Conversely, if the RSI value is below 30, the asset is considered oversold, suggesting it could be poised for an upward reversal or recovery. RSI is a useful tool for traders to determine market conditions and make informed decisions about entering or exiting trades based on the perceived strength or weakness of an asset's price movements.
This strategy uses RSI as a short-term trend approximation. If RSI crosses over 50 it means that there is a high probability of short-term trend change from downtrend to uptrend. Therefore RSI above 50 is our first trend filter to look for a long position.
 The MACD  (Moving Average Convergence Divergence) is a popular momentum and trend-following indicator used in technical analysis. It helps traders identify changes in the strength, direction, momentum, and duration of a trend in an asset's price.
The MACD consists of three components:
 MACD Line:  This is the difference between a short-term Exponential Moving Average (EMA) and a long-term EMA, typically calculated as:  MACD Line = 12 period EMA − 26 period EMA 
 Signal Line:  This is a 9-period EMA of the MACD Line, which helps to identify buy or sell signals. When the MACD Line crosses above the Signal Line, it can be a bullish signal (suggesting a buy); when it crosses below, it can be a bearish signal (suggesting a sell).
 Histogram:  The histogram shows the difference between the MACD Line and the Signal Line, visually representing the momentum of the trend. Positive histogram values indicate increasing bullish momentum, while negative values indicate increasing bearish momentum.
This strategy uses MACD as a second short-term trend filter. When MACD line crossed over the signal line there is a high probability that uptrend has been started. Therefore MACD line above signal line is our additional short-term trend filter. In conjunction with RSI it decreases probability of following false trend change signals.
The  Stochastic Indicator  is a momentum oscillator that compares a security's closing price to its price range over a specific period. It's used to identify overbought and oversold conditions. The indicator ranges from 0 to 100, with readings above 80 indicating overbought conditions and readings below 20 indicating oversold conditions.
It consists of two lines:
 
 %K:  The main line, calculated using the formula  (CurrentClose−LowestLow)/(HighestHigh−LowestLow)×100 . Highest and lowest price taken for 14 periods.
 %D:  A smoothed moving average of %K, often used as a signal line.
 
This strategy uses stochastic to define the overbought conditions. The logic here is the following: we want to avoid long trades in the overbought territory, because when indicator reaches it there is a high probability that the potential move is gonna be restricted.
The  200-period EMA  is a widely recognized indicator for identifying the long-term trend direction. The strategy only trades in the direction of this primary trend to increase the probability of successful trades. For instance, when the price is above the 200 EMA, only long trades are considered, aligning with the overarching trend direction.
Therefore, strategy uses combination of RSI and MACD to increase the probability that price now is in short-term uptrend, Stochastic helps to avoid the trades in the overbought (>80) territory. To increase the probability of opening long trades in the direction of a main trend and avoid local bounces we use 200 period EMA. 
ATR is used to adjust the strategy risk management to the current market volatility. If volatility is low, we don’t need the large stop loss to understand the there is a high probability that we made a mistake opening the trade. User can setup the settings ATR Stop Loss and ATR Trailing Profit Activation Level to realize his own risk to reward preferences, but the unique feature of a strategy is that after reaching trailing profit activation level strategy is trying to follow the trend until it is likely to be finished instead of using fixed risk management settings. It allows sometimes to be involved in the large movements.
 Backtest Results 
 
 Operating window:  Date range of backtests is 2023.01.01 - 2024.08.01. It is chosen to let the strategy to close all opened positions.
 Commission and Slippage:  Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
 Initial capital:  10000 USDT
 Percent of capital used in every trade:  30%
 Maximum Single Position Loss:  -3.94%
 Maximum Single Profit:  +15.78%
 Net Profit:  +1359.21 USDT (+13.59%)
 Total Trades:  111 (36.04% win rate)
 Profit Factor:  1.413
 Maximum Accumulated Loss:  625.02 USDT (-5.85%)
 Average Profit per Trade:  12.25 USDT (+0.40%)
 Average Trade Duration:  40 hours
 
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
 How to Use 
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 2h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
 Disclaimer: 
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Trend Signals with TP & SL [UAlgo] StrategyThe "Trend Signals with TP & SL   Strategy" is a trading strategy designed to capture trend continuation signals while incorporating sophisticated risk management techniques. This strategy is tailored for traders who wish to capitalize on trending market conditions with precise entry and exit points, automatically calculating Take Profit (TP) and Stop Loss (SL) levels based on either Average True Range (ATR) or percentage values. The strategy aims to enhance trade management by preventing multiple simultaneous positions and dynamically adapting to changing market conditions.
This strategy is highly configurable, allowing traders to adjust sensitivity, the ATR calculation method, and the cloud moving average length. Additionally, the strategy can display buy and sell signals directly on the chart, along with visual representation of entry points, stop losses, and take profits. It also features a cloud-based trend analysis using a MACD-driven color fill that indicates the strength and direction of the trend.
  
 🔶 Key Features 
 Configurable Trend Continuation Signals: 
 Source Selection:  The strategy uses the midpoint of the high-low range as the default source, but it is adjustable.
 Sensitivity:  The sensitivity of the trend signals can be adjusted using a multiplier, ranging from 0.5 to 5.
 ATR Calculation:  The strategy allows users to choose between two ATR calculation methods for better adaptability to different market conditions.
 Cloud Moving Average:  Traders can adjust the cloud moving average length, which is used in conjunction with MACD to provide a visual trend indication.
 Take Profit & Stop Loss Management: 
 ATR-Based or Percent-Based:  The strategy offers flexibility in setting TP and SL levels, allowing traders to choose between ATR-based multipliers or fixed percentage values.
 Dynamic Adjustment:  TP and SL levels are dynamically adjusted according to the selected method, ensuring trades are managed based on real-time market conditions.
Prevention of Multiple Positions:
 Single Position Control:  To reduce risk and enhance strategy reliability, the strategy includes an option to prevent multiple positions from being opened simultaneously.
 Visual Trade Indicators: 
 Buy/Sell Signals:  Clearly displays buy and sell signals on the chart for easy interpretation.
Entry, SL, and TP Lines: Draws lines for entry price, stop loss, and take profit directly on the chart, helping traders to monitor trades visually.
 Trend Cloud:  A color-filled cloud based on MACD and the cloud moving average provides a visual cue of the trend’s direction and strength.
 Performance Summary Table: 
 In-Chart Statistics:  A table in the top right of the chart displays key performance metrics, including total trades, wins, losses, and win rate percentage, offering a quick overview of the strategy’s effectiveness.
  
 🔶 Interpreting the Indicator 
Trend Signals: The strategy identifies trend continuation signals based on price action relative to an ATR-based threshold. A buy signal is generated when the price crosses above a key level, indicating an uptrend. Conversely, a sell signal occurs when the price crosses below a level, signaling a downtrend.
Cloud Visualization: The cloud, derived from MACD and moving averages, changes color to reflect the current trend. A positive cloud in aqua suggests an uptrend, while a red cloud indicates a downtrend. The transparency of the cloud offers further nuance, with more solid colors denoting stronger trends.
Entry and Exit Management: Once a trend signal is generated, the strategy automatically sets TP and SL levels based on your chosen method (ATR or percentage). The stop loss and take profit lines will appear on the chart, showing where the strategy will exit the trade. If the price reaches either the SL or TP, the trade is closed, and the respective line is deleted from the chart.
Performance Metrics: The strategy’s performance is tracked in real-time with an in-chart table. This table provides essential information about the number of trades executed, the win/loss ratio, and the overall win rate. This information helps traders assess the strategy's effectiveness and make necessary adjustments.
This strategy is designed for those who seek to engage with trending markets, offering robust tools for entry, exit, and overall trade management. By understanding and leveraging these features, traders can potentially improve their trading outcomes and risk management.
 🔷 Related Script 
  
 🔶 Disclaimer 
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
ChartArt-Bankniftybuying5minName: ChartArt-BankNifty Buying Strategy (5-Minute)
Timeframe: 5-Minute Candles
Asset: BankNifty (Indian Stock Market Index)
Trading Hours: 9:30 AM - 2:45 PM IST (Indian Standard Time)
This strategy is designed for BankNifty intraday traders who want to capitalize on short-term price movements within a defined trading window. It combines technical indicators like Simple Moving Averages (SMA), Relative Strength Index (RSI), and candlestick patterns to identify potential buy signals during intraday downtrends. The strategy employs specific entry, stop-loss, and target conditions to manage trades effectively and minimize risk.
Technical Indicators Used
Simple Moving Averages (SMA):
EMA7: 7-period SMA on closing price.
EMA5: 5-period SMA on closing price.
Purpose: Used to identify the intraday trend by comparing short-term moving averages. The strategy focuses on situations where the market is in a minor downtrend, indicated by EMA5 being below EMA7.
Relative Strength Index (RSI):
RSI14: 14-period RSI, a momentum oscillator that measures the speed and change of price movements.
SMA14: 14-period SMA of the RSI.
Purpose: RSI is used to identify potential reversal points. The strategy looks for situations where the RSI is below its own moving average, suggesting weakening momentum in the downtrend.
Candlestick Patterns:
Relaxed Hammer or Doji (2nd Candle): A pattern where the second candle in a 3-candle sequence shows a potential reversal signal (Hammer or Doji), indicating indecision or a potential turning point.
Bearish 1st Candle: The first candle is bearish, setting up the context for a potential reversal.
Bullish 3rd Candle: The third candle must be bullish with specific characteristics (closing near the high, surpassing the previous high), confirming the reversal.
Strategy Conditions
Time Condition:
The strategy is only active during specific hours (9:30 AM to 2:45 PM IST). This ensures that trades are only taken during the most liquid hours of the trading day, avoiding potential volatility or lack of liquidity towards market close.
Intraday Downtrend Condition:
EMA5 < EMA7: Indicates that the market is in a minor downtrend. The strategy looks for reversal opportunities within this trend.
RSI Condition:
RSI14 <= SMA14: Indicates that the current RSI value is below its 14-period SMA, suggesting potential weakening momentum, which can precede a reversal.
Candlestick Patterns:
1st Candle: Must be bearish, setting up the context for a potential reversal.
2nd Candle: Must either be a Hammer or Doji, indicating a potential reversal pattern.
3rd Candle: Must be bullish, with specific characteristics (closing near the high, breaking the previous high, etc.), confirming the reversal.
RSI Crossover Condition:
A crossover of the RSI over its SMA in the last 5 periods is also checked, adding further confirmation to the reversal signal.
Entry and Exit Rules
Entry Signal:
A buy signal is generated when all the conditions (time, intraday downtrend, bearish 1st candle, hammer/doji 2nd candle, bullish 3rd candle, and RSI condition) are met. The trade is entered at the high of the bullish third candle.
Stop Loss:
The stop loss is calculated based on the difference between the entry price and the low of the second candle. If this difference is greater than 90 points, the stop loss is placed at the midpoint of the second candle's range (average of high and low). Otherwise, it is placed at the low of the second candle.
Target 1:
The first target is set at 1.8 times the difference between the entry price and the stop loss. When this target is hit, half of the position is exited to lock in partial profits.
Target 2:
The second target is set at 3 times the difference between the entry price and the stop loss. The remaining position is exited at this point, or if the price hits the stop loss.
Originality and Usefulness
This strategy is original in its combination of multiple technical indicators and candlestick patterns to identify potential reversals in a specific intraday timeframe. By focusing on minor downtrends and utilizing a 3-candle reversal pattern, the strategy seeks to capture quick price movements with a structured approach to risk management.
Key Benefits:
High Precision: The strategy’s multi-step filtering process (time condition, trend confirmation, candlestick pattern analysis, and momentum evaluation via RSI) increases the likelihood of accurate trade signals.
Risk Management: The use of a dynamic stop-loss based on candle characteristics, combined with partial profit-taking, allows traders to lock in profits while still giving the trade room to develop further.
Structured Approach: The strategy provides a clear, rule-based system for entering and exiting trades, which can help remove emotional decision-making from the trading process.
Charts and Signals
The strategy produces signals in the form of labels on the chart:
Buy Signal: A green label is plotted below the candle that meets all entry conditions, indicating a potential buy opportunity.
Stop Loss (SL): A red dashed line is drawn at the stop-loss level with a label indicating "SL".
Target 1 (1st TG): A blue dashed line is drawn at the first target level with a label indicating "1st TG".
Target 2 (2nd TG): Another blue dashed line is drawn at the second target level with a label indicating "2nd TG".
These visual aids help traders quickly identify entry points, stop loss levels, and target levels on the chart, making the strategy easy to follow and implement.
Backtesting and Optimization
Backtesting: The strategy can be backtested on TradingView using historical data to evaluate its performance. Traders should consider testing across different market conditions to ensure the strategy's robustness.
Optimization: Parameters such as the RSI period, moving averages, and target multipliers can be optimized based on backtesting results to refine the strategy further.
Conclusion
The ChartArt-BankNifty Buying Strategy offers a well-rounded approach to intraday trading, focusing on capturing reversals in minor downtrends. With a strong emphasis on technical analysis, precise entry and exit rules, and robust risk management, this strategy provides a solid framework for traders looking to engage in intraday trading on BankNifty.
Risk Management Calculator with Fees and Take Profit [CHE]Risk Management Calculator with Fees and Take Profit  
Welcome to the Risk Management Calculator with Fees and Take Profit script! This powerful tool is designed to help traders manage their risk effectively, calculate leverage, and set take profit targets. The script is inspired by and builds upon the ideas from the following TradingView script:  ().
This script is inspired by and builds upon the ideas from the following TradingView script: 
  Features 
1. Portfolio Size Input: Enter the size of your portfolio to accurately calculate your risk and leverage.
2. Max Loss Percent Input: Specify the maximum percentage of your portfolio that you are willing to risk on a single trade.
3. Max Leverage Input: Set the maximum leverage you are comfortable using.
4. Trading Fee Input: Include trading fees in your calculations to get a more realistic view of your potential losses and gains.
5. ATR Settings: Configure the ATR period and multiplier to calculate your stop loss and take profit levels.
6. RSI Settings: Adjust the RSI period for trend analysis.
  How to Use 
 Portfolio Size
- Description: This is the total value of your trading account.
- Input: `portfolioSize`
- Default Value: 100
- Minimum Value: 0.001
 Max Loss Percent
- Description: The maximum percentage of your portfolio you are willing to lose on a single trade.
- Input: `maxLossPercent`
- Default Value: 3%
- Range: 0.1% to 100%
 Max Leverage
- Description: The maximum leverage you wish to use.
- Input: `maxLeverage`
- Default Value: 125
- Range: 1 to 125
 Trading Fee
- Description: The fee percentage you pay per trade.
- Input: `feeRate`
- Default Value: 1%
- Range: 0% to 10%
 ATR Settings
- ATR Period: Number of bars used to calculate the Average True Range.
  - Input: `atrPeriod`
  - Default Value: 5
- ATR Multiplier: Multiplier for ATR to set stop loss levels.
  - Input: `atrMultiplier`
  - Default Value: 2.0
 Take Profit Multiplier
- Description: Multiplier for ATR to set take profit levels.
- Input: `takeProfitMultiplier`
- Default Value: 2.0
 RSI Settings
- RSI Period: Period for the RSI calculation.
  - Input: `rsiPeriod`
  - Default Value: 14
 Dashboard
The script includes a customizable dashboard that displays the following information:
- Portfolio Size
- Maximum Loss Amount
- Entry Price
- Stop Loss Price
- Stop Loss Percentage
- Calculated Leverage
- Order Value
- Order Quantity
- Trend Direction
- Adjusted Maximum Loss Percentage
- Take Profit Price
 Dashboard Settings
- Location: Choose the position of the dashboard on the chart.
  - Options: 'Top Right', 'Bottom Right', 'Top Left', 'Bottom Left'
- Size: Adjust the size of the dashboard text.
  - Options: 'Tiny', 'Small', 'Normal', 'Large'
- Text/Frame Color: Set the color for the text and frame of the dashboard.
  Underlying Principles and Assumptions 
  Leverage Calculation 
The leverage calculation is fundamental to risk management in trading. It ensures that the risk per trade does not exceed a specified percentage of the portfolio. This calculation takes into account the potential loss from the entry price to the stop loss level, adjusted for trading fees. By dividing the maximum acceptable loss by the total potential loss (including fees), we derive a leverage that limits the exposure per trade. This approach helps traders avoid over-leveraging, which can lead to significant losses.
  ATR and Stop Loss 
The Average True Range (ATR) is used to set stop loss levels because it measures market volatility. A higher ATR indicates more volatility, which means wider stop losses are needed to avoid being prematurely stopped out by normal market fluctuations. By using an ATR multiplier, the stop loss is dynamically adjusted based on current market conditions, providing a more robust risk management strategy.
  Take Profit Calculation 
The take profit level is calculated as a multiple of the ATR, ensuring that it is set at a realistic level relative to market volatility. This method aims to capture significant price movements while avoiding the noise of smaller fluctuations. Setting take profit targets this way helps in locking in profits when the market moves favorably.
  RSI for Trend Confirmation 
The Relative Strength Index (RSI) is used to confirm the trend direction. An RSI above 50 typically indicates a bullish trend, while an RSI below 50 indicates a bearish trend. By aligning trades with the prevailing trend, the script increases the probability of successful trades. This trend confirmation helps in making informed decisions about leverage and position sizing.
  Risk Color Coding 
The script uses color coding to visually indicate the risk level and trend direction. Green indicates a favorable condition for long trades, red for short trades, and gray for neutral conditions. This intuitive color coding aids in quickly assessing the market conditions and making timely trading decisions.
 Conclusion
This script aims to provide a comprehensive risk management tool for traders. By integrating portfolio size, leverage, fees, ATR, and RSI, it helps in making informed trading decisions. We hope you find this tool useful in your trading journey.
Happy Trading!
Smart Money Concept + Strategy Backtesting Toolkit [Shah]This indicator, primarily designed for strategy backtest. It’s important to emphasize that the orders generated by this indicator are in the form of  stop-limit orders .
For  Long setup , When lower lows and lower highs form, after price moving up from the last higher high, a “change of character” occurs. Entry will takes place in the golden zone.
This the Long setup:
  
And this is the Long setup Example on chart:
  
For  Short setup , When higher lows and higher highs form after the price moves down from the last higher low, a “change of character” occurs. Entry will take place within the golden zone.
This the Short setup:
  
And this is the Short setup Example on chart:
  
 Key Features: 
 Date Period: 
Users can customize the date period during which the strategy is tested, allowing for a more granular analysis of performance over specific timeframes.
 DCA Entry: 
 
 Entry is based on Fibonacci level between the Lower Low and Higher High pivots for  Long deals .
 Entry is based on Fibonacci level between the Higher High and Lower Low pivots for  Short deals .
 Allowing a second entry with a specified position size
 Entering at a different price based on a Percent or ATR change.
 
There is a feature that If the risk-to-reward ratio is below the specified input (rr), the trading deal wont initiate, and the signal alert wont be triggered.
 Stop Loss: 
Adjustable based on Fibonacci levels , Percent and ATR.
The percent and ATR is calculate from LL pivot point for Long and HH pivot point for short (not Entry price)’
 Targets: 
Adjustable based on Source, Fibonacci levels , Percent and ATR.
 
 Source indicates the maximum (minimum) value between the open and close of the candle where the Higher High (Lower Low) pivot point was formed for Long (Short) deals.
 Percent and ATR calculates from Entry 1 Price
 
There is a feature that closes the part of the position size at Target 1 based on a percentage, leaving the rest to close at Target 2, entry, exit price, or stop loss.
 Plots: 
The visual representation of the indicator includes the key plots:
 
 Reset Deal Calculation Fibonacci Level
 Alert Fire Fibonacci Level
 Entry 1
 Entry 2
 Entry Average
 Stop Loss
 Target 1
 Target 2
 
 Labels: 
Displays informative labels upon trade open and close, providing details about each transaction like gain and equity and etc.
 Risk Management: 
Allows setting initial capital, risk per trade, and commission for each transaction.
 Score Table: 
Provides statistical information for Regular deals (refers to deals that closed in Target price or Stop loss price) and Exited deals (representing deals that didn’t touch the stop loss or targets.):
 
 Number of trades
 Win rate
 Profit factor
 Average Risk to Reward ratio
 Total Profit and Loss (PnL)
 Commission paid
 Live equity
 
  
It should note that Winrate calculated based on closed deals at target or stop loss. (Exited trades doesn’t into account in calculation of Winrate)
 Exit Methods : 
The goal is to offer users a diverse set of exits before the price touches the target or stop loss.
 1. Pending Entry Time-out 
cancel pending entry based on candle counting since alert fired. (before deal started)
 2. Break Even 
If Target 2 is reached, the stop loss automatically adjusts to the entry price.
 3. Active Deal Reverse 
If a deal (long or short position) is currently open, and the reverse signal is emitted, the script will close the existing deal.
 4. Reverse Deal Exit 
If a deal (long or short position) is currently open, and the reverse signal is emitted, the script will automatically close the existing deal.
 5. Move Exit 
With this method, if Entry 2 is triggered, the deal will be closed when the price touches the Entry price.
 6. Candle Counting Exit 
This exit type is based on the number of candles since the deal started.
 7. Profit Zone Shield Exit 
Once a deal enters profit, the Exit level moves to the entry level after reaching a Fibonacci level between TP1 and Entry 1.
 Deep Backtesting Table: 
It includes:
 
 Time period of the backtest
 Pair name and timeframe
 Count the long and short trades
 Win streak and loss streak
 Total deal chances and missed chances
 Count the deals goes directly from entry 1 to tp1 and entry 2 to tp1
 Count the deals that touched entry 2 and entry 2 filled percent
 Count the number of each exit type
 Other statistics such as CAGR, Sharpe, Kurtosis, Skewness, and Max Drawdown.
 
 
ATR GOD Strategy by TradeSmart (PineConnector-compatible)This is a  highly-customizable trading strategy  made by TradeSmart, focusing mainly on ATR-based indicators and filters. The strategy is mainly intended for  trading forex , and has been optimized using the Deep Backtest feature on the 2018.01.01 - 2023.06.01 interval on the EUR/USD (FXCM) 15M chart, with a Slippage value of 3, and a Commission set to 0.00004 USD per contract. The strategy is also made  compatible with PineConnector , to provide an easy option to  automate the strategy  using a connection to MetaTrader. See tooltips for details on how to set up the bot, and check out our website for a  detailed guide  with images on how to automate the strategy.
 The strategy was implemented using the following logic: 
 Entry strategy: 
A total of 4 Supertrend values can be used to determine the entry logic. There is option to set up all 4 Supertrend parameters individually, as well as their potential to be used as an entry signal/or a trend filter. Long/Short entry signals will be determined based on the selected potential Supertrend entry signals, and filtered based on them being in an uptrend/downtrend (also available for setup). Please use the provided tooltips for each setup to see every detail.
 Exit strategy: 
4 different types of Stop Losses are available: ATR-based/Candle Low/High Based/Percentage Based/Pip Based. Additionally, Force exiting can also be applied, where there is option to set up 4 custom sessions, and exits will happen after the session has closed.
 Parameters of every indicator used in the strategy can be tuned in the strategy settings as follows: 
 Plot settings: 
 
 Plot Signals: true by default, Show all Long and Short signals on the signal candle
 Plot SL/TP lines: false by default, Checking this option will result in the TP and SL lines to be plotted on the chart.
 
 Supertrend 1-4: 
All the parameters of the Supertrends can be set up here, as well as their individual role in the entry logic.
 Exit Strategy: 
 
 ATR Based Stop Loss: true by default
 ATR Length (of the SL): 100 by default
 ATR Smoothing (of the SL): RMA/SMMA by default
 Candle Low/High Based Stop Loss: false by default, recent lowest or highest point (depending on long/short position) will be used to calculate stop loss value. Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
 Candle Lookback (of the SL): 50 by default
 Percentage Based Stop Loss: false by default, Set the stop loss to current price - % of current price (long) or price + % of current price (short).
 Percentage (of the SL): 0.3 by default
 Pip Based Stop Loss: Set the stop loss to current price - x pips (long) or price + x pips (short). Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
 Pip (of the SL): 10 by default
 Base Risk Multiplier: 4.5 by default, the stop loss will be placed at this risk level (meaning in case of ATR SL that the ATR value will be multiplied by this factor and the SL will be placed that value away from the entry level)
 Risk to Reward Ratio: 1.5 by default, the take profit level will be placed such as this Risk/Reward ratio is met
 
 Force Exiting: 
4 total Force exit on custom session close options: none applied by default. If enabled, trades will close automatically after the set session is closed (on next candle's open).
 Base Setups: 
 
 Allow Long Entries: true by default
 Allow Short Entries: true by default
 Order Size: 10 by default
 Order Type: Capital Percentage by default, allows adjustment on how the position size is calculated: Cash: only the set cash amount will be used for each trade Contract(s): the adjusted number of contracts will be used for each trade Capital  Percentage: a % of the current available capital will be used for each trade
 
 ATR Limiter: 
 
 Use ATR Limiter: true by default, Only enter into any position (long/short) if ATR value is higher than the Low Boundary and lower than the High Boundary.
 ATR Limiter Length: 50 by default
 ATR Limiter Smoothing: RMA/SMMA by default
 High Boundary: 1000 by default
 Low Boundary: 0.0003 by default
 MA based calculation: ATR value under MA by default, If not Unspecified, an MA is calculated with the ATR value as source. Only enter into position (long/short) if ATR value is higher/lower than the MA.
 MA Type: RMA/SMMA by default
 MA Length: 400 by default
 
 Waddah Attar Filter: 
 
 Explosion/Deadzone relation: Not specified by default, Explosion over Deadzone: trades will only happen if the explosion line is over the deadzone line; Explosion under Deadzone: trades will only happen if the explosion line is under the deadzone line; Not specified: the opening of trades will not be based on the relation between the explosion and deadzone lines.
 Limit trades based on trends: Not specified by default, Strong Trends: only enter long if the WA bar is colored green (there is an uptrend and the current bar is higher then the previous); only enter short if the WA bar is colored red (there is a downtrend and the current bar is higher then the previous); Soft Trends: only enter long if the WA bar is colored lime (there is an uptrend and the current bar is lower then the previous); only enter short if the WA bar is colored orange (there is a downtrend and the current bar is lower then the previous); All Trends: only enter long if the WA bar is colored green or lime (there is an uptrend); only enter short if the WA bar is colored red or orange (there is a downtrend); Not specified: the color of the WA bar (trend) is not relevant when considering entries.
 WA bar value: Not specified by default, Over Explosion and Deadzone: only enter trades when the WA bar value is over the Explosion and Deadzone lines; Not specified: the relation between the explosion/deadzone lines to the value of the WA bar will not be used to filter opening trades.
 Sensitivity: 150 by default
 Fast MA Type: SMA by default
 Fast MA Length: 10 by default
 Slow MA Type: SMA
 Slow MA Length: 20 by default
 Channel MA Type: EMA by default
 BB Channel Length: 20 by default
 BB Stdev Multiplier: 2 by default
 
 Trend Filter: 
 
 Use long trend filter 1: false by default, Only enter long if price is above Long MA.
 Show long trend filter 1: false by default, Plot the selected MA on the chart.
 TF1 - MA Type: EMA by default
 TF1 - MA Length: 120 by default
 TF1 - MA Source: close by default
 Use short trend filter 1: false by default, Only enter long if price is above Long MA.
 Show short trend filter 1: false by default, Plot the selected MA on the chart.
 TF2 - MA Type: EMA by default
 TF2 - MA Length: 120 by default
 TF2 - MA Source: close by default
 
 Volume Filter: 
 
 Only enter trades where volume is higher then the volume-based MA: true by default, a set type of MA will be calculated with the volume as source, and set length
 MA Type: RMA/SMMA by default
 MA Length: 200 by default
 
 Date Range Limiter: 
 
 Limit Between Dates: false by default
 Start Date: Jan 01 2023 00:00:00 by default
 End Date: Jun 24 2023 00:00:00 by default
 
 Session Limiter: 
 
 Show session plots: false by default, show market sessions on chart: Sidney (red), Tokyo (orange), London (yellow), New York (green)
 Use session limiter: false by default, if enabled, trades will only happen in the ticked sessions below.
 Sidney session: false by default, session between: 15:00 - 00:00 (EST)
 Tokyo session: false by default, session between: 19:00 - 04:00 (EST)
 London session: false by default, session between: 03:00 - 11:00 (EST)
 New York session: false by default, session between: 08:00 - 17:00 (EST)
 
 Trading Time: 
 
 Limit Trading Time: true by default, tick this together with the options below to enable limiting based on day and time
 Valid Trading Days Global: 123567 by default, if the Limit Trading Time is on, trades will only happen on days that are present in this field. If any of the not global Valid Trading Days is used, this field will be neglected. Values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) To trade on all days use: 123457
 (1) Valid Trading Days: false, 123456 by default, values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) The script will trade on days that are present in this field. Please make sure that this field and also (1) Valid Trading Hours Between is checked
 (1) Valid Trading Hours Between: false, 1800-2000 by default, hours between which the trades can happen. The time is always in the exchange's timezone
 All other options are also disabled by default
 
 PineConnector Automation: 
 
 Use PineConnector Automation: false by default, In order for the connection to MetaTrader to work, you will need do perform prerequisite steps, you can follow our full guide at our website, or refer to the official PineConnector Documentation. To set up PineConnector Automation on the TradingView side, you will need to do the following: 
1. Fill out the License ID field with your PineConnector License ID; 
2. Fill out the Risk (trading volume) with the desired volume to be traded in each trade (the meaning of this value depends on the EA settings in Metatrader. Follow the detailed guide for additional information); 
3. After filling out the fields, you need to enable the 'Use PineConnector Automation' option (check the box in the strategy settings); 
4. Check if the chart has updated and you can see the appropriate order comments on your chart; 
5. Create an alert with the strategy selected as Condition, and the Message as {{strategy.order.comment}} (should be there by default); 
6. Enable the Webhook URL in the Notifications section, set it as the official PineConnector webhook address and enjoy your connection with MetaTrader.
 License ID: 60123456789 by default
 Risk (trading volume): 1 by default
 
 NOTE!  Fine-tuning/re-optimization is highly recommended when using other asset/timeframe combinations.
GKD-BT Multi-Ticker CC Backtest [Loxx]The Giga Kaleidoscope GKD-BT Multi-Ticker CC Backtest is a backtest module included in Loxx's "Giga Kaleidoscope Modularized Trading System."
 █ Giga Kaleidoscope GKD-BT Multi-Ticker CC Backtest 
This backtest allows you to test GKD-C Confirmation 1 and GKD-C Confirmation 2 indicators together without the hassle of adding additional confluence indicators. The backtest includes 1 take profit and 1 SL and various types of volatility. The backtest results on the chart are using 10% equity of 1 million total equity and $5 commission per trade. 
 To use this indicator: 
1. Import the value "Input into NEW GKD-BT Backtest" from the GKD-C Confirmation 1 indicator into the GKD-BT Multi-Ticker CC Backtest.
2. Import the value "Input into NEW GKD-BT Backtest" from the GKD-C Confirmation 2 indicator into the GKD-BT Multi-Ticker CC Backtest.
 This backtest includes the following metrics: 
1. Net profit: Overall profit or loss achieved.
2. Total Closed Trades: Total number of closed trades, both winning and losing.
3. Total Percent Wins: Total wins, whether long or short, for the selected time interval regardless of commissions and other profit-modifying addons.
4. Percent Profitable: Total wins, whether long or short, that are also profitable, taking commissions into account.
5. Profit Factor: The ratio of gross profits to gross losses, indicating how much money the strategy made for every unit of money it lost.
6. Average Profit per Trade: The average gain or loss per trade, calculated by dividing the net profit by the total number of closed trades.
7. Average Number of Bars in Trade: The average number of bars that elapsed during trades for all closed trades.
 Summary of notable settings: 
Input Tickers separated by commas: Allows the user to input tickers separated by commas, specifying the symbols or tickers of financial instruments used in the backtest. The tickers should follow the format "EXCHANGE:TICKER" (e.g., "NASDAQ:AAPL, NYSE:MSFT").
Import GKD-B Baseline: Imports the "GKD-B Baseline" indicator.
Import GKD-V Volatility/Volume: Imports the "GKD-V Volatility/Volume" indicator.
Import GKD-C Confirmation: Imports the "GKD-C Confirmation" indicator.
Import GKD-C Continuation: Imports the "GKD-C Continuation" indicator.
Initial Capital: Represents the starting account balance for the backtest, denominated in the base currency of the trading account.
Order Size: Determines the quantity of contracts traded in each trade.
Order Type: Specifies the type of order used in the backtest, either "Contracts" or "% Equity."
Commission: Represents the commission per order or transaction cost incurred in each trade.
 █ Giga Kaleidoscope Modularized Trading System 
 Core components of an NNFX algorithmic trading strategy 
The NNFX algorithm is built on the principles of trend, momentum, and volatility. There are six core components in the NNFX trading algorithm:
1. Volatility - price volatility; e.g., Average True Range, True Range Double, Close-to-Close, etc.
2. Baseline - a moving average to identify price trend
3. Confirmation 1 - a technical indicator used to identify trends
4. Confirmation 2 - a technical indicator used to identify trends
5. Continuation - a technical indicator used to identify trends
6. Volatility/Volume - a technical indicator used to identify volatility/volume breakouts/breakdown
7. Exit - a technical indicator used to determine when a trend is exhausted
8. Metamorphosis - a technical indicator that produces a compound signal from the combination of other GKD indicators*
*(not part of the NNFX algorithm)
 What is Volatility in the NNFX trading system? 
In the NNFX (No Nonsense Forex) trading system, ATR (Average True Range) is typically used to measure the volatility of an asset. It is used as a part of the system to help determine the appropriate stop loss and take profit levels for a trade. ATR is calculated by taking the average of the true range values over a specified period.
True range is calculated as the maximum of the following values:
-Current high minus the current low
-Absolute value of the current high minus the previous close
-Absolute value of the current low minus the previous close
ATR is a dynamic indicator that changes with changes in volatility. As volatility increases, the value of ATR increases, and as volatility decreases, the value of ATR decreases. By using ATR in NNFX system, traders can adjust their stop loss and take profit levels according to the volatility of the asset being traded. This helps to ensure that the trade is given enough room to move, while also minimizing potential losses.
Other types of volatility include True Range Double (TRD), Close-to-Close, and Garman-Klass
 What is a Baseline indicator? 
The baseline is essentially a moving average, and is used to determine the overall direction of the market.
The baseline in the NNFX system is used to filter out trades that are not in line with the long-term trend of the market. The baseline is plotted on the chart along with other indicators, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR).
Trades are only taken when the price is in the same direction as the baseline. For example, if the baseline is sloping upwards, only long trades are taken, and if the baseline is sloping downwards, only short trades are taken. This approach helps to ensure that trades are in line with the overall trend of the market, and reduces the risk of entering trades that are likely to fail.
By using a baseline in the NNFX system, traders can have a clear reference point for determining the overall trend of the market, and can make more informed trading decisions. The baseline helps to filter out noise and false signals, and ensures that trades are taken in the direction of the long-term trend.
 What is a Confirmation indicator? 
Confirmation indicators are technical indicators that are used to confirm the signals generated by primary indicators. Primary indicators are the core indicators used in the NNFX system, such as the Average True Range (ATR), the Moving Average (MA), and the Relative Strength Index (RSI).
The purpose of the confirmation indicators is to reduce false signals and improve the accuracy of the trading system. They are designed to confirm the signals generated by the primary indicators by providing additional information about the strength and direction of the trend.
Some examples of confirmation indicators that may be used in the NNFX system include the Bollinger Bands, the MACD (Moving Average Convergence Divergence), and the MACD Oscillator. These indicators can provide information about the volatility, momentum, and trend strength of the market, and can be used to confirm the signals generated by the primary indicators.
In the NNFX system, confirmation indicators are used in combination with primary indicators and other filters to create a trading system that is robust and reliable. By using multiple indicators to confirm trading signals, the system aims to reduce the risk of false signals and improve the overall profitability of the trades.
 What is a Continuation indicator? 
In the NNFX (No Nonsense Forex) trading system, a continuation indicator is a technical indicator that is used to confirm a current trend and predict that the trend is likely to continue in the same direction. A continuation indicator is typically used in conjunction with other indicators in the system, such as a baseline indicator, to provide a comprehensive trading strategy.
 What is a Volatility/Volume indicator? 
Volume indicators, such as the On Balance Volume (OBV), the Chaikin Money Flow (CMF), or the Volume Price Trend (VPT), are used to measure the amount of buying and selling activity in a market. They are based on the trading volume of the market, and can provide information about the strength of the trend. In the NNFX system, volume indicators are used to confirm trading signals generated by the Moving Average and the Relative Strength Index. Volatility indicators include Average Direction Index, Waddah Attar, and Volatility Ratio. In the NNFX trading system, volatility is a proxy for volume and vice versa.
By using volume indicators as confirmation tools, the NNFX trading system aims to reduce the risk of false signals and improve the overall profitability of trades. These indicators can provide additional information about the market that is not captured by the primary indicators, and can help traders to make more informed trading decisions. In addition, volume indicators can be used to identify potential changes in market trends and to confirm the strength of price movements.
 What is an Exit indicator? 
The exit indicator is used in conjunction with other indicators in the system, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR), to provide a comprehensive trading strategy.
The exit indicator in the NNFX system can be any technical indicator that is deemed effective at identifying optimal exit points. Examples of exit indicators that are commonly used include the Parabolic SAR, the Average Directional Index (ADX), and the Chandelier Exit.
The purpose of the exit indicator is to identify when a trend is likely to reverse or when the market conditions have changed, signaling the need to exit a trade. By using an exit indicator, traders can manage their risk and prevent significant losses.
In the NNFX system, the exit indicator is used in conjunction with a stop loss and a take profit order to maximize profits and minimize losses. The stop loss order is used to limit the amount of loss that can be incurred if the trade goes against the trader, while the take profit order is used to lock in profits when the trade is moving in the trader's favor.
Overall, the use of an exit indicator in the NNFX trading system is an important component of a comprehensive trading strategy. It allows traders to manage their risk effectively and improve the profitability of their trades by exiting at the right time.
 What is an Metamorphosis indicator? 
The concept of a metamorphosis indicator involves the integration of two or more GKD indicators to generate a compound signal. This is achieved by evaluating the accuracy of each indicator and selecting the signal from the indicator with the highest accuracy. As an illustration, let's consider a scenario where we calculate the accuracy of 10 indicators and choose the signal from the indicator that demonstrates the highest accuracy.
The resulting output from the metamorphosis indicator can then be utilized in a GKD-BT backtest by occupying a slot that aligns with the purpose of the metamorphosis indicator. The slot can be a GKD-B, GKD-C, or GKD-E slot, depending on the specific requirements and objectives of the indicator. This allows for seamless integration and utilization of the compound signal within the GKD-BT framework.
How does Loxx's GKD (Giga Kaleidoscope Modularized Trading System) implement the NNFX algorithm outlined above?
Loxx's GKD v2.0 system has five types of modules (indicators/strategies). These modules are:
1. GKD-BT - Backtesting module (Volatility, Number 1 in the NNFX algorithm)
2. GKD-B - Baseline module (Baseline and Volatility/Volume, Numbers 1 and 2 in the NNFX algorithm)
3. GKD-C - Confirmation 1/2 and Continuation module (Confirmation 1/2 and Continuation, Numbers 3, 4, and 5 in the NNFX algorithm)
4. GKD-V - Volatility/Volume module (Confirmation 1/2, Number 6 in the NNFX algorithm)
5. GKD-E - Exit module (Exit, Number 7 in the NNFX algorithm)
6. GKD-M - Metamorphosis module (Metamorphosis, Number 8 in the NNFX algorithm, but not part of the NNFX algorithm)
(additional module types will added in future releases)
Each module interacts with every module by passing data to A backtest module wherein the various components of the GKD system are combined to create a trading signal.
That is, the Baseline indicator passes its data to Volatility/Volume. The Volatility/Volume indicator passes its values to the Confirmation 1 indicator. The Confirmation 1 indicator passes its values to the Confirmation 2 indicator. The Confirmation 2 indicator passes its values to the Continuation indicator. The Continuation indicator passes its values to the Exit indicator, and finally, the Exit indicator passes its values to the Backtest strategy.
This chaining of indicators requires that each module conform to Loxx's GKD protocol, therefore allowing for the testing of every possible combination of technical indicators that make up the six components of the NNFX algorithm.
 What does the application of the GKD trading system look like? 
Example trading system:
Backtest: Multi-Ticker CC Backtest as shown on the chart above
Baseline: Hull Moving Average  
Volatility/Volume: Hurst Exponent  
Confirmation 1: Fisher Transform as shown on the chart above 
Confirmation 2: uf2018 as shown on the chart above
Continuation: Coppock Curve  
Exit: Rex Oscillator
Metamorphosis: Baseline Optimizer 
Each GKD indicator is denoted with a module identifier of either: GKD-BT, GKD-B, GKD-C, GKD-V, GKD-M, or GKD-E. This allows traders to understand to which module each indicator belongs and where each indicator fits into the GKD system.
 █ Giga Kaleidoscope Modularized Trading System Signals 
 Standard Entry 
1. GKD-C Confirmation gives signal
2. Baseline agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Volatility/Volume agrees
 1-Candle Standard Entry 
1a. GKD-C Confirmation gives signal
2a. Baseline agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
 Next Candle 
1b. Price retraced
2b. Baseline agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Baseline Entry 
1. GKD-B Baseline gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Volatility/Volume agrees
7. Confirmation 1 signal was less than 'Maximum Allowable PSBC Bars Back' prior
 1-Candle Baseline Entry 
1a. GKD-B Baseline gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSBC Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Baseline agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Volatility/Volume Entry 
1. GKD-V Volatility/Volume gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Baseline agrees
7. Confirmation 1 signal was less than 7 candles prior
 1-Candle Volatility/Volume Entry 
1a. GKD-V Volatility/Volume gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSVVC Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Volatility/Volume agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Baseline agrees
 Confirmation 2 Entry 
1. GKD-C Confirmation 2 gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Volatility/Volume agrees
6. Baseline agrees
7. Confirmation 1 signal was less than 7 candles prior
 1-Candle Confirmation 2 Entry 
1a. GKD-C Confirmation 2 gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSC2C Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Confirmation 2 agrees
3b. Confirmation 1 agrees
4b. Volatility/Volume agrees
5b. Baseline agrees
 PullBack Entry 
1a. GKD-B Baseline gives signal
2a. Confirmation 1 agrees
3a. Price is beyond 1.0x Volatility of Baseline
 Next Candle 
1b. Price inside Goldie Locks Zone Minimum
2b. Price inside Goldie Locks Zone Maximum
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Continuation Entry 
1. Standard Entry, 1-Candle Standard Entry, Baseline Entry, 1-Candle Baseline Entry, Volatility/Volume Entry, 1-Candle Volatility/Volume Entry, Confirmation 2 Entry, 1-Candle Confirmation 2 Entry, or Pullback entry triggered previously
2. Baseline hasn't crossed since entry signal trigger
4. Confirmation 1 agrees
5. Baseline agrees
6. Confirmation 2 agrees
 █ Connecting to Backtests 
All GKD indicators are chained indicators meaning you export the value of the indicators to specialized backtest to creat your GKD trading system. Each indicator contains a proprietary signal generation algo that will only work with GKD backtests. You can find these backtests using the links below.
GKD-BT Giga Confirmation Stack Backtest 
  
GKD-BT Giga Stacks Backtest 
  
GKD-BT Full Giga Kaleidoscope Backtest
  
GKD-BT Solo Confirmation Super Complex Backtest 
  
GKD-BT Solo Confirmation Complex Backtest
  
GKD-BT Solo Confirmation Simple Backtest
  
GKD-M Baseline Optimizer  
  
GKD-M Accuracy Alchemist  
  
GKD-BT Multi-Ticker SCC Backtest
  
GKD-BT Multi-Ticker SCS Backtest  
  
GKD-BT Multi-Ticker SCS Backtest  
  
GKD-BT Multi-Ticker Full GKD Backtest
 
Premium Smart Exit HMA [ByteBoost]The Premium Smart Exit HMA   strategy is designed for fast-paced trend detection and is well-suited for small trades in highly volatile markets. It utilizes the Hull Moving Average (HMA) as a signal to execute trades and offers customizable inputs for price calculation, period settings, and stop loss/take profit levels. The strategy aims to reduce lag associated with traditional moving averages, allowing it to catch trends quickly.
 Development Notes 
This Strategy was developed with the PineScript language, version 5. The aim of the strategy is to provide a trading system that catches fast trend reversals and uses a modified version of the Hull Moving Average. The HMA adeptly adapts to swift variations in price movements while offering better smoothing and utilizes a user selected moving averages, mitigating the smoothing effect and is controlled with a custom weight design.
 Features  
 
 Customizable trading periods.
 Customizable stop loss and take profit levels.
 Adjustable date range for backtesting.
 Allows setting of initial capital, commission type and value.
 Provides visual aids for better understanding of the market trends.
 Customize the visuals of the strategy.
 
  
 Strategy Description 
The Smart Exit HMA strategy offers the flexibility to use various types of moving averages, allowing customization of inputs for price calculation, period settings, and stop loss/take profit levels. The strategy relies on the Hull Moving Average (HMA) as a signal to execute trades. However, you have control over the signal frequency by selecting your preferred period value, which determines the number of candles used in the average calculation. This allows you to adapt the strategy to market tendencies and increase its effectiveness during clear trends.
The Smart Exit HMA strategy is designed to minimize lag associated with traditional moving averages, enabling it to respond more quickly to recent price movements based on your chosen period. It's worth noting that the strategy plots two lines on the graph: the average line and the square root line. Buy and sell signals are generated when both lines intersect, indicating favorable trading opportunities.
  
 Inputs/Settings  
 Capital  - If using any leverage multiply the amount of money to invest by the leverage, else input the amount to be invested in every trade.
 Start date  - The date from which the strategy should begin its analysis. Leave unchanged to start from the earliest available date based on your account's plan.
 End date  - The date until which the strategy should conduct its analysis. Leave unchanged to continue until the current date.
 Period  - The lookback period for the moving average calculation, a longer period will translate into fewer trades that last longer.
 Stop loss  - Allows the use of a stop loss for all trades.
 Take profit  - Activates the use of a take profit for all trades.
 Stop loss value  - The distance from the entry price at which the strategy should exit to prevent further losses.
 Take profit value  - The distance from the entry price at which the strategy should exit to secure profits.
 Take profit %  - The percentage of the capital to take as profit.
 Stop loss %  - The percentage of the capital to set as the maximum loss.
 Candles exit  - The minimum number of candles before the strategy is allowed to close a trade.
 Candles change  - The minimum number of candles before the strategy is allowed to change the current trend.
 Moving average type  - Determines the preprocessing method applied prior to utilizing the HMA.
 Custom weight  - Enables the utilization of a personalized weighting system for the HMA. If chosen, ensure that the sum of all weights equals 1.
 Open weight  - Determines the weight assigned to the candle's open value.
 Close weight  - Specifies the weight assigned to the candle's close value.
 High weight  - Sets the weight attributed to the candle's high value.
 Low weight  - Determines the weight assigned to the candle's low value.
 Highlighter  - Light coloring between the trend and average price of each bar.
 Signal labels  - View the labels indicating a new long or short position.
 Exit labels  - Displays the labels indicating exit points.
 Color long  - Sets the color scheme for a new long position.
 Color short  - Sets the color scheme for a new short position.
 Color exit  - Decides the color scheme for the exit tag and cross shown.
 Indicator Visuals 
The strategy plots the two trendlines on the chart and changes its color based on its direction. It also plots shapes on the chart to denote potential buy (Long) and sell (Short) points where the signals of short and long will appear, as well as crosses for the exit points.
 Strategy Alerts 
The strategy does not include built-in alerts. However, alerts can be added using the TradingView interface based on the strategy's buy, sell and exit conditions. This way you will be able to receive notifications on your computer or phone when a new signal goes out.
 Details 
Repainting: It is important to mention that the strategy can mark an uptrend signal during a candle and disappear at the end of it, so please just put long or short when the buy/sell conditions are followed and marked by the strategy at the end of each candle. 
 Conclusion 
The Premium Smart Exit HMA   is a versatile strategy that combines the benefits of the Hull Moving Average with adjustable parameters to suit individual trading styles. It offers a combination of speed and smoothness, which can be beneficial in volatile markets.
 Disclaimer 
This strategy is provided as-is, with no guarantee of profits or responsibility for losses. Trading involves risk, and you should only trade with money you can afford to lose. Always conduct your own research and consider your financial situation before engaging in trading.
GKD-M Accuracy Alchemist [Loxx]Giga Kaleidoscope GKD-M Accuracy Alchemist is a Metamorphosis module included in Loxx's "Giga Kaleidoscope Modularized Trading System".
 █ GKD-M Accuracy Alchemist 
 What is the Accuracy Alchemist? 
The Accuracy Alchemist is designed to process up to 10 GKD-C indicators and create a compound signal that can be utilized in a GKD-BT backtest. It achieves this by applying an individual Solo Confirmation Simple backtest to each GKD-C indicator provided. The compound signal is derived from the cumulative accuracy rate of each candle within a specified date range.
To illustrate this process, consider the following scenario:
The Fisher Transform indicator has a 65% win rate for long positions on the current ticker.
The Vortex indicator has a 45% success rate on the current candle.
Suppose a long signal is generated by the Vortex indicator. However, this signal is disregarded because its accuracy is lower than that of the Fisher Transform. Now, imagine that the subsequent candle produces a long signal from the Fisher Transform indicator. This signal will be exported to the backtest. The GKD-C indicator that exhibits the highest accuracy for the current candle is chosen to generate the signal. The dominant indicator, determined by its accuracy, will always be used to generate signals. However, it is important to note that the current dominant indicator might not retain its dominance in the future if its accuracy rate falls below that of other indicators connected within the Accuracy Alchemist indicator.
The Accuracy Alchemist provides a comprehensive table that displays the dominant indicator based on accuracy, highlighted in green for the highest long accuracy rate and in red for the highest short accuracy rate. Additionally, the table presents the cumulative long and short accuracy rates for all indicators.
The functionality of the Accuracy Alchemist extends to several GKD-BT backtests, allowing for seamless integration. These backtests include:
-Solo Confirmation Simple
-Solo Confirmation Complex
-Solo Confirmation Super Complex
-Full GKD (as a Confirmation 1 indicator only)
-Confirmation Stack (as a Confirmation 1 indicator only)
By incorporating the Accuracy Alchemist, you gain the ability to evaluate and compare GKD-C Confirmation indicators within your full GKD trading system. It serves as an ideal tool to assess the performance of different confirmation indicators and aids in the selection process for determining which indicators to incorporate into your trading strategy.
 Take Profit and Stoploss 
The GKD system utilizes volatility-based take profits and stop losses, where each take profit and stop loss is calculated as a multiple of volatility. Users have the flexibility to adjust the multiplier values in the settings to suit their preferences. Accuracy Alchemist tests the accuracy of GKD-C Confirmation indicators and therefore has only 1 take profit and 1 stoploss. You can adjust the multipliers of both in the settings
 Setting up Accuracy Alchemist 
To use this indicator, you must import GKD-C Confirmation indicators and then activate them in the Accuracy Alchemist settings. Import the value "Input into NEW GKD-BT Backtest" from a GKD-C indicator and then activate it by checking the box next to the import. See below: 
  
 Volatility Types Included 
17 types of volatility are included in this indicator 
Close-to-Close
Parkinson
Garman-Klass
Rogers-Satchell
Yang-Zhang
Garman-Klass-Yang-Zhang
Exponential Weighted Moving Average
Standard Deviation of Log Returns
Pseudo GARCH(2,2)
Average True Range
True Range Double
Standard Deviation
Adaptive Deviation
Median Absolute Deviation
Efficiency-Ratio Adaptive ATR
Mean Absolute Deviation
Static Percent
 Close-to-Close 
Close-to-Close volatility is a classic and widely used volatility measure, sometimes referred to as historical volatility.
Volatility is an indicator of the speed of a stock price change. A stock with high volatility is one where the price changes rapidly and with a larger amplitude. The more volatile a stock is, the riskier it is.
Close-to-close historical volatility is calculated using only a stock's closing prices. It is the simplest volatility estimator. However, in many cases, it is not precise enough. Stock prices could jump significantly during a trading session and return to the opening value at the end. That means that a considerable amount of price information is not taken into account by close-to-close volatility.
Despite its drawbacks, Close-to-Close volatility is still useful in cases where the instrument doesn't have intraday prices. For example, mutual funds calculate their net asset values daily or weekly, and thus their prices are not suitable for more sophisticated volatility estimators.
 Parkinson 
Parkinson volatility is a volatility measure that uses the stock’s high and low price of the day.
The main difference between regular volatility and Parkinson volatility is that the latter uses high and low prices for a day, rather than only the closing price. This is useful as close-to-close prices could show little difference while large price movements could have occurred during the day. Thus, Parkinson's volatility is considered more precise and requires less data for calculation than close-to-close volatility.
One drawback of this estimator is that it doesn't take into account price movements after the market closes. Hence, it systematically undervalues volatility. This drawback is addressed in the Garman-Klass volatility estimator.
 Garman-Klass 
Garman-Klass is a volatility estimator that incorporates open, low, high, and close prices of a security.
Garman-Klass volatility extends Parkinson's volatility by taking into account the opening and closing prices. As markets are most active during the opening and closing of a trading session, it makes volatility estimation more accurate.
Garman and Klass also assumed that the process of price change follows a continuous diffusion process (Geometric Brownian motion). However, this assumption has several drawbacks. The method is not robust for opening jumps in price and trend movements.
Despite its drawbacks, the Garman-Klass estimator is still more effective than the basic formula since it takes into account not only the price at the beginning and end of the time interval but also intraday price extremes.
Researchers Rogers and Satchell have proposed a more efficient method for assessing historical volatility that takes into account price trends. See Rogers-Satchell Volatility for more detail.
 Rogers-Satchell 
Rogers-Satchell is an estimator for measuring the volatility of securities with an average return not equal to zero.
Unlike Parkinson and Garman-Klass estimators, Rogers-Satchell incorporates a drift term (mean return not equal to zero). As a result, it provides better volatility estimation when the underlying is trending.
The main disadvantage of this method is that it does not take into account price movements between trading sessions. This leads to an underestimation of volatility since price jumps periodically occur in the market precisely at the moments between sessions.
A more comprehensive estimator that also considers the gaps between sessions was developed based on the Rogers-Satchel formula in the 2000s by Yang-Zhang. See Yang Zhang Volatility for more detail.
 Yang-Zhang 
Yang Zhang is a historical volatility estimator that handles both opening jumps and the drift and has a minimum estimation error.
Yang-Zhang volatility can be thought of as a combination of the overnight (close-to-open volatility) and a weighted average of the Rogers-Satchell volatility and the day’s open-to-close volatility. It is considered to be 14 times more efficient than the close-to-close estimator.
 Garman-Klass-Yang-Zhang 
Garman-Klass-Yang-Zhang (GKYZ) volatility estimator incorporates the returns of open, high, low, and closing prices in its calculation.
GKYZ volatility estimator takes into account overnight jumps but not the trend, i.e., it assumes that the underlying asset follows a Geometric Brownian Motion (GBM) process with zero drift. Therefore, the GKYZ volatility estimator tends to overestimate the volatility when the drift is different from zero. However, for a GBM process, this estimator is eight times more efficient than the close-to-close volatility estimator.
 Exponential Weighted Moving Average 
The Exponentially Weighted Moving Average (EWMA) is a quantitative or statistical measure used to model or describe a time series. The EWMA is widely used in finance, with the main applications being technical analysis and volatility modeling.
The moving average is designed such that older observations are given lower weights. The weights decrease exponentially as the data point gets older – hence the name exponentially weighted.
The only decision a user of the EWMA must make is the parameter lambda. The parameter decides how important the current observation is in the calculation of the EWMA. The higher the value of lambda, the more closely the EWMA tracks the original time series.
 Standard Deviation of Log Returns 
This is the simplest calculation of volatility. It's the standard deviation of ln(close/close(1)).
 Pseudo GARCH(2,2) 
This is calculated using a short- and long-run mean of variance multiplied by ?.
?avg(var;M) + (1 ? ?) avg(var;N) = 2?var/(M+1-(M-1)L) + 2(1-?)var/(M+1-(M-1)L)
Solving for ? can be done by minimizing the mean squared error of estimation; that is, regressing L^-1var - avg(var; N) against avg(var; M) - avg(var; N) and using the resulting beta estimate as ?.
 Average True Range 
The average true range (ATR) is a technical analysis indicator, introduced by market technician J. Welles Wilder Jr. in his book New Concepts in Technical Trading Systems, that measures market volatility by decomposing the entire range of an asset price for that period.
The true range indicator is taken as the greatest of the following: current high less the current low; the absolute value of the current high less the previous close; and the absolute value of the current low less the previous close. The ATR is then a moving average, generally using 14 days, of the true ranges.
 True Range Double 
A special case of ATR that attempts to correct for volatility skew.
 Standard Deviation 
Standard deviation is a statistic that measures the dispersion of a dataset relative to its mean and is calculated as the square root of the variance. The standard deviation is calculated as the square root of variance by determining each data point's deviation relative to the mean. If the data points are further from the mean, there is a higher deviation within the data set; thus, the more spread out the data, the higher the standard deviation.
 Adaptive Deviation 
By definition, the Standard Deviation (STD, also represented by the Greek letter sigma ? or the Latin letter s) is a measure that is used to quantify the amount of variation or dispersion of a set of data values. In technical analysis, we usually use it to measure the level of current volatility.
Standard Deviation is based on Simple Moving Average calculation for mean value. This version of standard deviation uses the properties of EMA to calculate what can be called a new type of deviation, and since it is based on EMA, we can call it EMA deviation. Additionally, Perry Kaufman's efficiency ratio is used to make it adaptive (since all EMA type calculations are nearly perfect for adapting).
The difference when compared to the standard is significant--not just because of EMA usage, but the efficiency ratio makes it a "bit more logical" in very volatile market conditions.
 Median Absolute Deviation 
The median absolute deviation is a measure of statistical dispersion. Moreover, the MAD is a robust statistic, being more resilient to outliers in a data set than the standard deviation. In the standard deviation, the distances from the mean are squared, so large deviations are weighted more heavily, and thus outliers can heavily influence it. In the MAD, the deviations of a small number of outliers are irrelevant.
Because the MAD is a more robust estimator of scale than the sample variance or standard deviation, it works better with distributions without a mean or variance, such as the Cauchy distribution.
 Efficiency-Ratio Adaptive ATR 
Average True Range (ATR) is a widely used indicator for many occasions in technical analysis. It is calculated as the RMA of the true range. This version adds a "twist": it uses Perry Kaufman's Efficiency Ratio to calculate adaptive true range.
 Mean Absolute Deviation 
The mean absolute deviation (MAD) is a measure of variability that indicates the average distance between observations and their mean. MAD uses the original units of the data, which simplifies interpretation. Larger values signify that the data points spread out further from the average. Conversely, lower values correspond to data points bunching closer to it. The mean absolute deviation is also known as the mean deviation and average absolute deviation.
This definition of the mean absolute deviation sounds similar to the standard deviation (SD). While both measure variability, they have different calculations. In recent years, some proponents of MAD have suggested that it replace the SD as the primary measure because it is a simpler concept that better fits real life.
 Static Percent 
Static Percent allows the user to insert their own constant percent that will then be used to create take profits and stoploss
 █ Giga Kaleidoscope Modularized Trading System 
 Core components of an NNFX algorithmic trading strategy 
The NNFX algorithm is built on the principles of trend, momentum, and volatility. There are six core components in the NNFX trading algorithm:
1. Volatility - price volatility; e.g., Average True Range, True Range Double, Close-to-Close, etc.
2. Baseline - a moving average to identify price trend 
3. Confirmation 1 - a technical indicator used to identify trends
4. Confirmation 2 - a technical indicator used to identify trends
5. Continuation - a technical indicator used to identify trends
6. Volatility/Volume - a technical indicator used to identify volatility/volume breakouts/breakdown
7. Exit - a technical indicator used to determine when a trend is exhausted
8. Metamorphosis - a technical indicator that produces a compound signal from the combination of other GKD indicators*
*(not part of the NNFX algorithm)
 What is Volatility in the NNFX trading system? 
In the NNFX (No Nonsense Forex) trading system, ATR (Average True Range) is typically used to measure the volatility of an asset. It is used as a part of the system to help determine the appropriate stop loss and take profit levels for a trade. ATR is calculated by taking the average of the true range values over a specified period.
True range is calculated as the maximum of the following values:
-Current high minus the current low
-Absolute value of the current high minus the previous close
-Absolute value of the current low minus the previous close
ATR is a dynamic indicator that changes with changes in volatility. As volatility increases, the value of ATR increases, and as volatility decreases, the value of ATR decreases. By using ATR in NNFX system, traders can adjust their stop loss and take profit levels according to the volatility of the asset being traded. This helps to ensure that the trade is given enough room to move, while also minimizing potential losses.
Other types of volatility include True Range Double (TRD), Close-to-Close, and Garman-Klass
 What is a Baseline indicator? 
The baseline is essentially a moving average, and is used to determine the overall direction of the market.
The baseline in the NNFX system is used to filter out trades that are not in line with the long-term trend of the market. The baseline is plotted on the chart along with other indicators, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR).
Trades are only taken when the price is in the same direction as the baseline. For example, if the baseline is sloping upwards, only long trades are taken, and if the baseline is sloping downwards, only short trades are taken. This approach helps to ensure that trades are in line with the overall trend of the market, and reduces the risk of entering trades that are likely to fail.
By using a baseline in the NNFX system, traders can have a clear reference point for determining the overall trend of the market, and can make more informed trading decisions. The baseline helps to filter out noise and false signals, and ensures that trades are taken in the direction of the long-term trend.
 What is a Confirmation indicator? 
Confirmation indicators are technical indicators that are used to confirm the signals generated by primary indicators. Primary indicators are the core indicators used in the NNFX system, such as the Average True Range (ATR), the Moving Average (MA), and the Relative Strength Index (RSI).
The purpose of the confirmation indicators is to reduce false signals and improve the accuracy of the trading system. They are designed to confirm the signals generated by the primary indicators by providing additional information about the strength and direction of the trend.
Some examples of confirmation indicators that may be used in the NNFX system include the Bollinger Bands, the MACD (Moving Average Convergence Divergence), and the MACD Oscillator. These indicators can provide information about the volatility, momentum, and trend strength of the market, and can be used to confirm the signals generated by the primary indicators.
In the NNFX system, confirmation indicators are used in combination with primary indicators and other filters to create a trading system that is robust and reliable. By using multiple indicators to confirm trading signals, the system aims to reduce the risk of false signals and improve the overall profitability of the trades.
 What is a Continuation indicator? 
In the NNFX (No Nonsense Forex) trading system, a continuation indicator is a technical indicator that is used to confirm a current trend and predict that the trend is likely to continue in the same direction. A continuation indicator is typically used in conjunction with other indicators in the system, such as a baseline indicator, to provide a comprehensive trading strategy.
 What is a Volatility/Volume indicator? 
Volume indicators, such as the On Balance Volume (OBV), the Chaikin Money Flow (CMF), or the Volume Price Trend (VPT), are used to measure the amount of buying and selling activity in a market. They are based on the trading volume of the market, and can provide information about the strength of the trend. In the NNFX system, volume indicators are used to confirm trading signals generated by the Moving Average and the Relative Strength Index. Volatility indicators include Average Direction Index, Waddah Attar, and Volatility Ratio. In the NNFX trading system, volatility is a proxy for volume and vice versa.
By using volume indicators as confirmation tools, the NNFX trading system aims to reduce the risk of false signals and improve the overall profitability of trades. These indicators can provide additional information about the market that is not captured by the primary indicators, and can help traders to make more informed trading decisions. In addition, volume indicators can be used to identify potential changes in market trends and to confirm the strength of price movements.
 What is an Exit indicator? 
The exit indicator is used in conjunction with other indicators in the system, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR), to provide a comprehensive trading strategy.
The exit indicator in the NNFX system can be any technical indicator that is deemed effective at identifying optimal exit points. Examples of exit indicators that are commonly used include the Parabolic SAR, the Average Directional Index (ADX), and the Chandelier Exit.
The purpose of the exit indicator is to identify when a trend is likely to reverse or when the market conditions have changed, signaling the need to exit a trade. By using an exit indicator, traders can manage their risk and prevent significant losses.
In the NNFX system, the exit indicator is used in conjunction with a stop loss and a take profit order to maximize profits and minimize losses. The stop loss order is used to limit the amount of loss that can be incurred if the trade goes against the trader, while the take profit order is used to lock in profits when the trade is moving in the trader's favor.
Overall, the use of an exit indicator in the NNFX trading system is an important component of a comprehensive trading strategy. It allows traders to manage their risk effectively and improve the profitability of their trades by exiting at the right time.
 What is an Metamorphosis indicator? 
The concept of a metamorphosis indicator involves the integration of two or more GKD indicators to generate a compound signal. This is achieved by evaluating the accuracy of each indicator and selecting the signal from the indicator with the highest accuracy. As an illustration, let's consider a scenario where we calculate the accuracy of 10 indicators and choose the signal from the indicator that demonstrates the highest accuracy.
The resulting output from the metamorphosis indicator can then be utilized in a GKD-BT backtest by occupying a slot that aligns with the purpose of the metamorphosis indicator. The slot can be a GKD-B, GKD-C, or GKD-E slot, depending on the specific requirements and objectives of the indicator. This allows for seamless integration and utilization of the compound signal within the GKD-BT framework.
 How does Loxx's GKD (Giga Kaleidoscope Modularized Trading System) implement the NNFX algorithm outlined above? 
Loxx's GKD v2.0 system has five types of modules (indicators/strategies). These modules are: 
1. GKD-BT - Backtesting module (Volatility, Number 1 in the NNFX algorithm)
2. GKD-B - Baseline module (Baseline and Volatility/Volume, Numbers 1 and 2 in the NNFX algorithm)
3. GKD-C - Confirmation 1/2 and Continuation module (Confirmation 1/2 and Continuation, Numbers 3, 4, and 5 in the NNFX algorithm)
4. GKD-V - Volatility/Volume module (Confirmation 1/2, Number 6 in the NNFX algorithm)
5. GKD-E - Exit module (Exit, Number 7 in the NNFX algorithm)
6. GKD-M - Metamorphosis module (Metamorphosis, Number 8 in the NNFX algorithm, but not part of the NNFX algorithm)
(additional module types will added in future releases)
Each module interacts with every module by passing data to A backtest module wherein the various components of the GKD system are combined to create a trading signal.
That is, the Baseline indicator passes its data to Volatility/Volume. The Volatility/Volume indicator passes its values to the Confirmation 1 indicator. The Confirmation 1 indicator passes its values to the Confirmation 2 indicator. The Confirmation 2 indicator passes its values to the Continuation indicator. The Continuation indicator passes its values to the Exit indicator, and finally, the Exit indicator passes its values to the Backtest strategy. 
This chaining of indicators requires that each module conform to Loxx's GKD protocol, therefore allowing for the testing of every possible combination of technical indicators that make up the six components of the NNFX algorithm. 
 What does the application of the GKD trading system look like? 
Example trading system: 
 
 Backtest: Full GKD Backtest
 Baseline: Hull Moving Average  
 Volatility/Volume: Hurst Exponent  
 Confirmation 1: Composite RSI
 Confirmation 2: uf2018
 Continuation: Vortex
 Exit: Rex Oscillator 
 Metamorphosis: Fisher Transform, Universal Oscillator, Aroon, Vortex .. combined 
 
Each GKD indicator is denoted with a module identifier of either: GKD-BT, GKD-B, GKD-C, GKD-V, or GKD-E. This allows traders to understand to which module each indicator belongs and where each indicator fits into the GKD system.
 █ Giga Kaleidoscope Modularized Trading System Signals  
 Standard Entry 
1. GKD-C Confirmation gives signal
2. Baseline agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Volatility/Volume agrees
 1-Candle Standard Entry 
1a. GKD-C Confirmation gives signal
2a. Baseline agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
 Next Candle 
1b. Price retraced
2b. Baseline agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Baseline Entry 
1. GKD-B Basline gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Volatility/Volume agrees
7. Confirmation 1 signal was less than 'Maximum Allowable PSBC Bars Back' prior
 1-Candle Baseline Entry 
1a. GKD-B Baseline gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSBC Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Baseline agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Volatility/Volume Entry 
1. GKD-V Volatility/Volume gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Confirmation 2 agrees
6. Baseline agrees
7. Confirmation 1 signal was less than 7 candles prior
 1-Candle Volatility/Volume Entry 
1a. GKD-V Volatility/Volume gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSVVC Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Volatility/Volume agrees
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Baseline agrees
 Confirmation 2 Entry 
1. GKD-C Confirmation 2 gives signal
2. Confirmation 1 agrees
3. Price inside Goldie Locks Zone Minimum
4. Price inside Goldie Locks Zone Maximum
5. Volatility/Volume agrees
6. Baseline agrees
7. Confirmation 1 signal was less than 7 candles prior
 1-Candle Confirmation 2 Entry 
1a. GKD-C Confirmation 2 gives signal
2a. Confirmation 1 agrees
3a. Price inside Goldie Locks Zone Minimum
4a. Price inside Goldie Locks Zone Maximum
5a. Confirmation 1 signal was less than 'Maximum Allowable PSC2C Bars Back' prior
 Next Candle 
1b. Price retraced
2b. Confirmation 2 agrees
3b. Confirmation 1 agrees
4b. Volatility/Volume agrees
5b. Baseline agrees
 PullBack Entry 
1a. GKD-B Baseline gives signal
2a. Confirmation 1 agrees
3a. Price is beyond 1.0x Volatility of Baseline
 Next Candle 
1b. Price inside Goldie Locks Zone Minimum
2b. Price inside Goldie Locks Zone Maximum
3b. Confirmation 1 agrees
4b. Confirmation 2 agrees
5b. Volatility/Volume agrees
 Continuation Entry 
1. Standard Entry, 1-Candle Standard Entry, Baseline Entry, 1-Candle Baseline Entry, Volatility/Volume Entry, 1-Candle Volatility/Volume Entry, Confirmation 2 Entry, 1-Candle Confirmation 2 Entry, or Pullback entry triggered previously
2. Baseline hasn't crossed since entry signal trigger
4. Confirmation 1 agrees
5. Baseline agrees
6. Confirmation 2 agrees
 █ Connecting to Backtests 
All GKD indicators are chained indicators meaning you export the value of the indicators to specialized backtest to creat your GKD trading system. Each indicator contains a proprietary signal generation algo that will only work with GKD backtests. You can find these backtests using the links below. 
GKD-BT Giga Confirmation Stack Backtest:
  
GKD-BT Giga Stacks Backtest:
  
GKD-BT Full Giga Kaleidoscope Backtest:
  
GKD-BT Solo Confirmation Super Complex Backtest:
  
GKD-BT Solo Confirmation Complex Backtest:
  
GKD-BT Solo Confirmation Simple Backtest:
 
CryptoGraph StrategizerA complete system to backtest and automate comprehensive trading strategies 
═════════════════════════════════════════════════════════════════════════
🟣  How it works 
This indicator allows you to use buy & sell signals from external CryptoGraph indicators, and fully backtest these signals in the TradingView strategy tester. After configuring buy & sell signals, the trader can look into exit criteria with this indicator. The indicator offers percentage based an ATR based take profit/stop losses, as well as safety orders (DCA) in order to get a better average entry price.
Once your strategy is fully set up to your desired results, it's possible to set up alerts and connect the indicator through an automation platform ( API connection), to your broker. Alertatron & Wick Hunter auto configuration is included, meaning everything configured in the indicator settings, will automatically be carried out with Alertatron & Wick Hunter syntaxes.
🟣  Features 
• Multiple methods of scaling in entries (Multiple DCA/Pyramiding methods). There will be an option to scale up or down your volume per order and distance between orders.
• Multiple methods of determining order sizes. Methods are percentage risk per trade, dollar risk per trade, position size in contracts, position size in percentage and position size in dollar.
• Multiple methods and levels of taking profits and losses. Both percentage based and ATR based take profit and stop loss.
• Option to use external indicator buy/sell signals for entry.
• Visualised liquidation prices in TradingView (both cross and isolated)
• Information panel on chart with additional information regarding your strategy results
• Bot setup directly from indicator inputs tab with Wick Hunter & Alertatron
🟣  How to use 
• Choose a symbol that corresponds to your bot pair and exchange
• Pick a chart time frame
• Always use the regular candle type
• Configure your deal start condition
• Configure your profit target
• Use the Take Profit/Stop Loss feature to set a target for profit and loss
• Configure your safety orders
• Check your backtest parameters
•Make sure that the initial capital and order size make sense. Since you can use pyramiding in your strategy with safety orders, the sum of all deals should not be bigger than the initial capital
Channels Strategy [JoseMetal]============
ENGLISH
============
- Description:
This strategy is based on Bollinger Bands / Keltner Channel price "rebounds" (the idea of price bouncing from one band to another).
The strategy has several customizable options, which allows you to refine the strategy for your asset and timeframe.
You can customize settings for ALL indicators, Bollinger Bands (period and standard deviation), Keltner Channel (period and ATR multiplier) and ATR (period).
- AVAILABLE INDICATORS:
You can pick Bollinger Bands or Keltner Channels for the strategy, the chosen indicator will be plotted as well.
- CUSTOM CONDITIONS TO ENTER A POSITION:
1. Price breaks the band (low below lower band for LONG or high above higher band for SHORT).
2. Same as 1 but THEN (next candle) price closes INSIDE the bands.
3. Price breaks the band AND CLOSES OUT of the band (lower band for LONG and higher band for SHORT).
4. Same as 3 but THEN (next candle) price closes INSIDE the bands.
- STOP LOSS OPTIONS:
1. Previous wick (low of previous candle if LONG and high or previous candle if SHORT).
2. Extended band, you can customize settings for a second indicator with larger values to use it as STOP LOSS, for example, Bollinger Bands with 2 standard deviations to open positions and 3 for STOP LOSS.
3. ATR: you can pick average true ratio from a source (like closing price) with a multiplier to calculate STOP LOSS.
- TAKE PROFIT OPTIONS:
1. Opposite band (top band for LONGs, bottom band for SHORTs).
2. Moving average: Bollinger Bands simple moving average or Keltner Channel exponential moving average .
3. ATR: you can pick average true ratio from a source (like closing price) with a multiplier to calculate TAKE PROFIT.
- OTHER OPTIONS:
You can pick to trade only LONGs, only SHORTs, both or none (just indicator).
You can enable DYNAMIC TAKE PROFIT, which updates TAKE PROFIT on each candle, for example, if you pick "opposite band" as TAKE PROFIT, it'll update the TAKE PROFIT based on that, on every single new candle.
- Visual:
Bands shown will depend on the chosen indicator and it's settings.
ATR is only printed if used as STOP LOSS and/or TAKE PROFIT.
- Recommendations:
Recommended on DAILY timeframe , it works better with Keltner Channels rather than Bollinger Bands .
- Customization:
As you can see, almost everything is customizable, for colors and plotting styles check the "Style" tab.
Enjoy!
============
ESPAÑOL
============
- Descripción:
Esta estrategia se basa en los "rebotes" de precios en las Bandas de Bollinger / Canal de Keltner (la idea de que el precio rebote de una banda a otra).
La estrategia tiene varias opciones personalizables, lo que le permite refinar la estrategia para su activo y temporalidad favoritas.
Puedes personalizar la configuración de TODOS los indicadores, Bandas de Bollinger (periodo y desviación estándar), Canal de Keltner (periodo y multiplicador ATR) y ATR (periodo).
- INDICADORES DISPONIBLES:
Puedes elegir las Bandas de Bollinger o los Canales de Keltner para la estrategia, el indicador elegido será mostrado en pantalla.
- CONDICIONES PERSONALIZADAS PARA ENTRAR EN UNA POSICIÓN:
1. El precio rompe la banda (mínimo por debajo de la banda inferior para LONG o máximo por encima de la banda superior para SHORT).
2. Lo mismo que en el punto 1 pero ADEMÁS (en la siguiente vela) el precio cierra DENTRO de las bandas.
3. El precio rompe la banda Y CIERRA FUERA de la banda (banda inferior para LONG y banda superior para SHORT).
4. Igual que el 3 pero ADEMÁS (siguiente vela) el precio cierra DENTRO de las bandas.
- OPCIONES DE STOP LOSS:
1. Mecha anterior (mínimo de la vela anterior si es LONGy máximo de la vela anterior si es SHORT).
2. Banda extendida, puedes personalizar la configuración de un segundo indicador con valores más extensos para utilizarlo como STOP LOSS, por ejemplo, Bandas de Bollinger con 2 desviaciones estándar para abrir posiciones y 3 para STOP LOSS.
3. ATR: puedes elegir el average true ratio de una fuente (como el precio de cierre) con un multiplicador para calcular el STOP LOSS.
- OPCIONES DE TAKE PROFIT:
1. Banda opuesta (banda superior para LONGs, banda inferior para SHORTs).
2. Media móvil: media móvil simple de las Bandas de Bollinger o media móvil exponencial del Canal de Keltner .
3. ATR: se puede escoger el average true ratio de una fuente (como el precio de cierre) con un multiplicador para calcular el TAKE PROFIT.
- OTRAS OPCIONES:
Puedes elegir operar sólo con LONGs, sólo con SHORTs, ambos o ninguno (sólo el indicador).
Puedes activar el TAKE PROFIT DINÁMICO, que actualiza el TAKE PROFIT en cada vela, por ejemplo, si eliges "banda opuesta" como TAKE PROFIT, actualizará el TAKE PROFIT basado en eso, en cada nueva vela.
- Visual:
Las bandas mostradas dependerán del indicador elegido y de su configuración.
El ATR sólo se muestra si se utiliza como STOP LOSS y/o TAKE PROFIT.
- Recomendaciones:
Recomendada para temporalidad de DIARIO, funciona mejor con los Canales de Keltner que con las Bandas de Bollinger .
- Personalización:
Como puedes ver, casi todo es personalizable, para los colores y estilos de dibujo comprueba la pestaña "Estilo".
¡Que lo disfrutes!
MACD Strategy - Backtest [AlgoRider]█ OVERVIEW
Hello dear Tradingviewers !
We are excited to share with you this new indicator which simulates a trading strategy based solely on the well-known technical indicator MACD . We designed it for the sole educational and analytical purposes of showing novice traders and new investors that basing a trading strategy only on one such technical indicator is not necessarily a good thing to do. We do not recommend to apply this strategy for real.
Thanks to this indicator redesigned in our own way by incorporating our simple and easy-to-use Backtest functionality, you will be able to see and report on the performance and results that such a strategy has produced in the past.
The configuration window has also been designed to be easily readable and simple to use. Our goal is to make parameter customization as easy as possible.
█ HOW THE STRATEGY WORKS
  •   The script will simply trigger Long entries when bullish MACD crossings appear (the Macd line crosses the Signal line upwards) and Short entries when bearish MACD crossings appear (the Macd line crosses below the signal line).
  •   A Short signal ends a Long trade, a Long signal ends a Short trade.
  •   The script also allows setting up custom TP and SL.
  •   An option allows you to trigger early crossings, which will influence entries and exits.
  •   There is no repaint, once an entry/exit symbol or drawing is displayed it doesn't change anymore. The Short and Long signals appear at the open of the candles, just after the signal was confirmed at the close of the previous candle. The custom TP and custom SL signals can appear when a candle is not yet finished, but once displayed they don't change.
█ HOW TO PROCEED
 1 —  Once the script is applied to your chart, it already works with its default settings. You can already see the performance of the strategy in the data table directly on the chart (in the top right corner by default).
 2 —  You can customize the strategy and influence the results/performance by modifying its parameters. 3 types of parameters are present and can be modified.
 3 —  You can use this indicator in all types of markets.
 4 —  You can apply the script in every timeframe.
█ PARAMETERS
• Settings For Backtesting
  - Strategy :   Choose from a drop-down list if the strategy should execute only Long trades or only Short trades or both. Default Both.
  - Invest.   :   Choose the amount you want to invest in the simulation. Default 10000.
 -  Position  :   Choose the amount of the position (Size order) that will be used during the simulation. This will be the $ amount staked/involved for each trade entry.
Ex: If you put 20000 in position and 10000 in Invest. We consider that you use at least a leverage x2. Default 10000.
  - Slipp. TP :   Choose the amount in percentage of average slippage for Take Profits. This parameter makes it possible to predict a potential gap between the theoretical exit price for each TP (On the graph) and the real exit price on an exchange when implementing the strategy for real (slippage may be due to a time lag of a few seconds from execution time of the order on the exchange and/or due to the execution of a market order).
Ex: If a TP exit order of a Long trade, with entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $20000, in practice on the exchange the script have indeed sent an exit order at 20000 , but if the true exit price is 20050, the TP slippage is then +0.25%. Default 0.
  - Slipp. SL :   Choose the amount in percentage of average slippage for Stop Losses. This parameter makes it possible to predict a potential gap between the theoretical exit price for each SL (On the graph) and the real exit price on an exchange when implementing the strategy for real.
Ex: If an SL exit order of a Long trade, entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $18000, in practice on the exchange the script have indeed sent an exit order at 18000 $, but if the true exit price is 17950, the slippage SL is then +0.278%. Default 0.
  - Fees %  :   Choose the percentage amount of fees applied to each trade to simulate the application of the strategy on the exchange of your choice. Applies to the entry and exit of each trade. Ex: For Binance Futures: 0.04; For Bybit futures: 0.06; For Ftx Futures: 0.075. Default 0.
  -  Cumulate Trades  :   If you check this, the Backtest will use 100% of the balance as Order Size (Position) for All or in the next X consecutive trades. Default not checked.
⚠️ Be Careful please, this option is available to show the full extent and possibilities of the algorithm when pushed to its limits thanks to the accumulation of profits (cumulative earnings ), but it is a strategy that involves great risk. If a bad trade suffers a -50% loss, 50% of the account balance is lost, if the position is liquidated, the entire account balance is lost.
  - All          :   If you check this All trades will be accumulated. Default not checked.
  - Consecutive Trades :   Choose the number of trades to accumulate. After X consecutive trades, the algorithm reassigns the initial order size to the current one and starts again for X consecutive trades. Minimum Value 2, Default 2.
• Settings To Optimize Performances and Risk Management
  - Fast_MA         :  Choose the length of the Fast Moving Average. Default 12.
  - Slow_MA        :  Choose the length of the Slow Moving Average. Default 26.
  - Enable Early Crossings  :  If you check this, when the algorithm will detect an early crossing wethere bullish or bearish , it will trigger the Long or Short entries. Default not checked.
  - Oscillator MA Type   :  Choose if the Macd line should be an Exponential Moving Average or a Simple Moving Average . Default Expo.
  - Signal Line MA Type    :  Choose if the Signal line should be an Exponential Moving Average or a Simple Moving Average . Default Expo.
  - Use TP / Use SL     :  If you check these, the algorithm will trigger personalized trade exit signals when the price evolution has reached the amounts indicated since the trade entry. Default not Checked.
 -  % TP - SL        :  Indicate here the personalized amount in percentage that you want for your Take Profit and Stop Loss of each trade. Default 15-5.
• Settings For Appearances
  - Small-size Data Table  : If you check this, the data table will become smaller to free up more space on the chart to make it visually more pleasing. Default not checked.
       Hide Table  /
  -   Hide Labels /     : You can check these to get a cleaner chart and focus only on what interests you in the indicator. Default not checked.
   Hide Risk-Reward Areas
█ LIMITATIONS
  •   ⚠️ We repeat it once again, this strategy is not intended to be reproduced in real conditions, we have designed it for educational and analytical purposes only.
  •   Even if you see good performances when you backtest the strategy, you must take into account that these results are performed in the past and that in no case does this guarantee that these same performances will be repeated again in the future.
  •   When you run for real a trading strategy you must be aware of the fact that you are solely responsible for the results that you will be able to obtain and you must be aware of the possibility at all times of partial or even total losses of your invested capital.
  •   Keep in mind that generating profits in trading is difficult. A strategy can perform very well at one time in the past during a period that is favorable to it, then from one day to the next it can give really bad results for several months or years.
  •   When backtesting a trading strategy, there are many factors to consider, not just trade entries to which you add a Take Profit and sometimes a Stop Loss. You must at least take into account the size of the position in relation to the capital you want to invest, the trading fees, the slippages (which can be really important depending on the exchange on which you are trading and depending on the asset you are trading), trading frequency, risk management, momentum, volumes and even more.
The information published here on TradingView is not prohibited, doesn't constitute investment advice, and isn't created solely for qualified investors.
═════════════════════════════════════════════════════════════════════════
 Important to note :  our indicators with the same backtesting system are published in separate publications, because putting them together in a single script would considerably slow down the execution of the script. In addition each indicator, even when it is based on a simple technical indicator, has several options, parameters and entry/exit conditions specific to the underlying technical indicator. Finally, we want to keep the simplicity of use, configuration and understanding of our indicator by not mixing strategies that have nothing to do with each other.
Webhook Starter Kit [HullBuster] 
  
 Introduction 
This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins. 
The source code is written in a self documenting style with clearly defined sections. The sections “communicate” with each other through state variables making it easy for the strategy to evolve and improve. This is an excellent place for Pine Language beginners to start their strategy building journey. The script exhibits many Pine Language features which will certainly ad power to your script building abilities.
This script employs a basic trend follow strategy utilizing a forward pyramiding technique. Trend detection is implemented through the use of two higher time frame series. The market entry setup is a Simple Moving Average crossover. Positions exit by passing through conditional take profit logic. The script creates ten indicators including a Zscore oscillator to measure support and resistance levels. The indicator parameters are exposed through 47 strategy inputs segregated into seven sections. All of the inputs are equipped with detailed tool tips to help you get started.
To improve the transition from simulation to execution, strategy.entry and strategy.exit calls show enhanced message text with embedded keywords that are combined with the TradingView placeholders at alert time. Thereby, enabling a single JSON message to generate multiple execution events. This is genius stuff from the Pine Language development team. Really excellent work!
This document provides a sample alert message that can be applied to this script with relatively little modification. Without altering the code, the strategy inputs can alter the behavior to generate thousands of orders or simply a few dozen. It can be applied to crypto, stocks or forex instruments. A good way to look at this script is as a webhook lab that can aid in the development of your own endpoint processor, impress your co-workers and have hours of fun.
By no means is a webhook required or even necessary to benefit from this script. The setups, exits, trend detection, pyramids and DCA algorithms can be easily replaced with more sophisticated versions. The modular design of the script logic allows you to incrementally learn and advance this script into a functional trading system that you can be proud of.
 Design 
This is a trend following strategy that enters long above the trend line and short below. There are five trend lines that are visible by default but can be turned off in Section 7. Identified, in frequency order, as follows:
1.    - EMA in the chart time frame. Intended to track price pressure. Configured in Section 3.
2.    - ALMA in the higher time frame specified in Section 2 Signal Line Period.
3.    - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
4.    - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
5.    - DEMA in the higher time frame specified in Section 2 Trend Line Period.
The Blue, Green and Orange lines are signal lines are on the same time frame. The time frame selected should be at least five times greater than the chart time frame. The Purple line represents the trend line for which prices above the line suggest a rising market and prices below a falling market. The time frame selected for the trend should be at least five times greater than the signal lines.
Three oscillators are created as follows:
1.  Stochastic - In the chart time frame. Used to enter forward pyramids.
2.  Stochastic - In the Trend period. Used to detect exit conditions.
3.  Zscore - In the Signal period. Used to detect exit conditions.
The Stochastics are configured identically other than the time frame. The period is set in Section 2.
Two Simple Moving Averages provide the trade entry conditions in the form of a crossover. Crossing up is a long entry and down is a short. This is in fact the same setup you get when you select a basic strategy from the Pine editor. The crossovers are configured in Section 3. You can see where the crosses are occurring by enabling Show Entry Regions in Section 7.
The script has the capacity for pyramids and DCA. Forward pyramids are enabled by setting the Pyramid properties tab with a non zero value. In this case add on trades will enter the market on dips above the position open price. This process will continue until the trade exits. Downward pyramids are available in Crypto and Range mode only. In this case add on trades are placed below the entry price in the drawdown space until the stop is hit. To enable downward pyramids set the Pyramid Minimum Span In Section 1 to a non zero value.
This implementation of Dollar Cost Averaging (DCA) triggers off consecutive losses. Each loss in a run increments a sequence number. The position size is increased as a multiple of this sequence. When the position eventually closes at a profit the sequence is reset. DCA is enabled by setting the Maximum DCA Increments In Section 1 to a non zero value.
It should be noted that the pyramid and DCA features are implemented using a rudimentary design and as such do not perform with the precision of my invite only scripts. They are intended as a feature to stress test your webhook endpoint. As is, you will need to buttress the logic for it to be part of an automated trading system. It is for this reason that I did not apply a Martingale algorithm to this pyramid implementation. But, hey, it’s an open source script so there is plenty of room for learning and your own experimentation.
 How does it work 
The overall behavior of the script is governed by the Trading Mode selection in Section 1. It is the very first input so you should think about what behavior you intend for this strategy at the onset of the configuration. As previously discussed, this script is designed to be a trend follower. The trend being defined as where the purple line is predominately heading. In BiDir mode, SMA crossovers above the purple line will open long positions and crosses below the line will open short.  If pyramiding is enabled add on trades will accumulate on dips above the entry price. The value applied to the Minimum Profit input in Section 1 establishes the threshold for a profitable exit. This is not a hard number exit. The conditional exit logic must be satisfied in order to permit the trade to close. This is where the effort put into the indicator calibration is realized. There are four ways the trade can exit at a profit:
1.  Natural exit. When the blue line crosses the green line the trade will close. For a long position the blue line must cross under the green line (downward). For a short the blue must cross over the green (upward).
2.  Alma / Linear Regression event. The distance the blue line is from the green and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 6 and relies on the period and length set in Section 2. A long position will exit on an upward thrust which exceeds the activation threshold. A short will exit on a downward thrust.
3.  Exponential event. The distance the yellow line is from the blue and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 3 and relies on the period and length set in the same section.
4.  Stochastic event. The purple line stochastic is used to measure overbought and over sold levels with regard to position exits. Signal line positions combined with a reading over 80 signals a long profit exit. Similarly, readings below 20 signal a short profit exit.
Another, optional, way to exit a position is by Bale Out. You can enable this feature in Section 1. This is a handy way to reduce the risk when carrying a large pyramid stack. Instead of waiting for the entire position to recover we exit early (bale out) as soon as the profit value has doubled.
There are lots of ways to implement a bale out but the method I used here provides a succinct example. Feel free to improve on it if you like. To see where the Bale Outs occur, enable Show Bale Outs in Section 7. Red labels are rendered below each exit point on the chart.
There are seven selectable Trading Modes available from the drop down in Section 1:
1.  Long - Uses the strategy.risk.allow_entry_in to execute long only trades. You will still see shorts on the chart.
2.  Short - Uses the strategy.risk.allow_entry_in to execute short only trades. You will still see long trades on the chart.
3.  BiDir - This mode is for margin trading with a stop. If a long position was initiated above the trend line and the price has now fallen below the trend, the position will be reversed after the stop is hit. Forward pyramiding is available in this mode if you set the Pyramiding value in the Properties tab. DCA can also be activated.
4.  Flip Flop - This is a bidirectional trading mode that automatically reverses on a trend line crossover. This is distinctively different from BiDir since you will get a reversal even without a stop which is advantageous in non-margin trading.
5.  Crypto - This mode is for crypto trading where you are buying the coins outright. In this case you likely want to accumulate coins on a crash. Especially, when all the news outlets are talking about the end of Bitcoin and you see nice deep valleys on the chart. Certainly, under these conditions, the market will be well below the purple line. No margin so you can’t go short. Downward pyramids are enabled for Crypto mode when two conditions are met. First the Pyramiding value in the Properties tab must be non zero. Second the Pyramid Minimum Span in Section 1 must be non zero.
6.  Range - This is a counter trend trading mode. Longs are entered below the purple trend line and shorts above. Useful when you want to test your webhook in a market where the trend line is bisecting the signal line series. Remember that this strategy is a trend follower. It’s going to get chopped out in a range bound market. By turning on the Range mode you will at least see profitable trades while stuck in the range. However, when the market eventually picks a direction, this mode will sustain losses. This range trading mode is a rudimentary implementation that will need a lot of improvement if you want to create a reliable switch hitter (trend/range combo).
7.  No Trade. Useful when setting up the trend lines and the entry and exit is not important.
Once in the trade, long or short, the script tests the exit condition on every bar. If not a profitable exit then it checks if a pyramid is required. As mentioned earlier, the entry setups are quite primitive. Although they can easily be replaced by more sophisticated algorithms, what I really wanted to show is the diminished role of the position entry in the overall life of the trade. Professional traders spend much more time on the management of the trade beyond the market entry. While your trade entry is important, you can get in almost anywhere and still land a profitable exit.
If DCA is enabled, the size of the position will increase in response to consecutive losses. The number of times the position can increase is limited by the number set in Maximum DCA Increments of Section 1. Once the position breaks the losing streak the trade size will return the default quantity set in the Properties tab. It should be noted that the Initial Capital amount set in the Properties tab does not affect the simulation in the same way as a real account. In reality, running out of money will certainly halt trading. In fact, your account would be frozen long before the last penny was committed to a trade. On the other hand, TradingView will keep running the simulation until the current bar even if your funds have been technically depleted.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that the endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
 Webhook Integration 
The TradingView alerts dialog provides a way to connect your script to an external system which could actually execute your trade. This is a fantastic feature that enables you to separate the data feed and technical analysis from the execution and reporting systems. Using this feature it is possible to create a fully automated trading system entirely on the cloud. Of course, there is some work to get it all going in a reliable fashion. Being a strategy type script place holders such as {{strategy.position_size}} can be embedded in the alert message text. There are more than 10 variables which can write internal script values into the message for delivery to the specified endpoint. 
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that my endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Here is an excerpt of the fields I use in my webhook signal:
"broker_id": "kraken",
"account_id": "XXX XXXX XXXX XXXX",
"symbol_id": "XMRUSD",
"action": "{{strategy.order.action}}",
"strategy": "{{strategy.order.id}}",
"lots": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"comment": "{{strategy.order.alert_message}}",
"timestamp": "{{time}}"
Though TradingView does a great job in dispatching your alert this feature does come with a few idiosyncrasies. Namely, a single transaction call in your script may cause multiple transmissions to the endpoint. If you are using placeholders each message describes part of the transaction sequence. A good example is closing a pyramid stack. Although the script makes a single strategy.close() call, the endpoint actually receives a close message for each pyramid trade. The broker, on the other hand, only requires a single close. The incongruity of this situation is exacerbated by the possibility of messages being received out of sequence. Depending on the type of order designated in the message, a close or a reversal. This could have a disastrous effect on your live account. This broker simulator has no idea what is actually going on at your real account. Its just doing the job of running the simulation and sending out the computed results. If your TradingView simulation falls out of alignment with the actual trading account lots of really bad things could happen. Like your script thinks your are currently long but the account is actually short. Reversals from this point forward will always be wrong with no one the wiser. Human intervention will be required to restore congruence. But how does anyone find out this is occurring? In closed systems engineering this is known as entropy. In practice your webhook logic should be robust enough to detect these conditions. Be generous with the placeholder usage and give the webhook code plenty of information to compare states. Both issuer and receiver. Don’t blindly commit incoming signals without verifying system integrity.
 Setup 
The following steps provide a very brief set of instructions that will get you started on your first configuration. After you’ve gone through the process a couple of times, you won’t need these anymore. It’s really a simple script after all. I have several example configurations that I used to create the performance charts shown. I can share them with you if you like. Of course, if you’ve modified the code then these steps are probably obsolete.
There are 47 inputs divided into seven sections. For the most part, the configuration process is designed to flow from top to bottom. Handy, tool tips are available on every field to help get you through the initial setup.
Step 1. Input the Base Currency and Order Size in the Properties tab. Set the Pyramiding value to zero.
Step 2. Select the Trading Mode you intend to test with from the drop down in Section 1. I usually select No Trade until I’ve setup all of the trend lines, profit and stop levels.
Step 3. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale). Remember that the profit is taken as a conditional exit not a fixed limit. The actual profit taken will almost always be greater than the amount specified. The stop loss, on the other hand, is indeed a hard number which is executed by the TradingView broker simulator when the threshold is breached.
Step 4. Apply the appropriate value to the Tick Scalar field in Section 1. This value is used to remove the pipette from the price. You can enable the Summary Report in Section 7 to see the TradingView minimum tick size of the current chart.
Step 5. Apply the appropriate Price Normalizer value in Section 1. This value is used to normalize the instrument price for differential calculations. Basically, we want to increase the magnitude to significant digits to make the numbers more meaningful in comparisons. Though I have used many normalization techniques, I have always found this method to provide a simple and lightweight solution for less demanding applications. Most of the time the default value will be sufficient. The Tick Scalar and Price Normalizer value work together within a single calculation so changing either will affect all delta result values.
Step 6. Turn on the trend line plots in Section 7. Then configure Section 2. Try to get the plots to show you what’s really happening not what you want to happen. The most important is the purple trend line. Select an interval and length that seem to identify where prices tend to go during non-consolidation periods. Remember that a natural exit is when the blue crosses the green line.
Step 7.  Enable Show Event Regions in Section 7. Then adjust Section 6. Blue background fills are spikes and red fills are plunging prices. These measurements should be hard to come by so you should see relatively few fills on the chart if you’ve set this up as intended. Section 6 includes the Zscore oscillator the state of which combines with the signal lines to detect statistically significant price movement. The Zscore is a zero based calculation with positive and negative magnitude readings. You want to input a reasonably large number slightly below the maximum amplitude seen on the chart. Both rise and fall inputs are entered as a positive real number. You can easily use my code to create a separate indicator if you want to see it in action. The default value is sufficient for most configurations.
Step 8.  Turn off Show Event Regions and enable Show Entry Regions in Section 7. Then adjust Section 3. This section contains two parts. The entry setup crossovers and EMA events. Adjust the crossovers first. That is the Fast Cross Length and Slow Cross Length. The frequency of your trades will be shown as blue and red fills. There should be a lot. Then turn off Show Event Regions and enable Display EMA Peaks. Adjust all the fields that have the word EMA. This is actually the yellow line on the chart. The blue and red fills should show much less than the crossovers but more than event fills shown in Step 7.
Step 9. Change the Trading Mode to BiDir if you selected No Trades previously. Look on the chart and see where the trades are occurring. Make adjustments to the Minimum Profit and Stop Offset in Section 1 if necessary. Wider profits and stops reduce the trade frequency.
Step 10.  Go to Section 4 and 5 and make fine tuning adjustments to the long and short side.
 Example Settings 
To reproduce the performance shown on the chart please use the following configuration: (Bitcoin on the Kraken exchange)
1. Select XBTUSD Kraken as the chart symbol.
2. On the properties tab set the Order Size to: 0.01 Bitcoin
3. On the properties tab set the Pyramiding to: 12
4.   In Section 1: Select “Crypto” for the Trading Model
5.   In Section 1: Input 2000 for the Minimum Profit
6.   In Section 1: Input 0 for the Stop Offset (No Stop)
7.   In Section 1: Input 10 for the Tick Scalar
8.   In Section 1: Input 1000 for the Price Normalizer
9.   In Section 1: Input 2000 for the Pyramid Minimum Span
10. In Section 1: Check mark the Position Bale Out
11. In Section 2: Input 60 for the Signal Line Period
12. In Section 2: Input 1440 for the Trend Line Period
13. In Section 2: Input 5 for the Fast Alma Length
14. In Section 2: Input 22 for the Fast LinReg Length
15. In Section 2: Input 100 for the Slow LinReg Length
16. In Section 2: Input 90 for the Trend Line Length
17. In Section 2: Input 14 Stochastic Length
18. In Section 3: Input 9 Fast Cross Length
19. In Section 3: Input 24 Slow Cross Length
20. In Section 3: Input 8 Fast EMA Length
21. In Section 3: Input 10 Fast EMA Rise NetChg
22. In Section 3: Input 1 Fast EMA Rise ROC
23. In Section 3: Input 10 Fast EMA Fall NetChg
24. In Section 3: Input 1 Fast EMA Fall ROC
25. In Section 4: Check mark the Long Natural Exit
26. In Section 4: Check mark the Long Signal Exit
27. In Section 4: Check mark the Long Price Event Exit
28. In Section 4: Check mark the Long Stochastic Exit
29. In Section 5: Check mark the Short Natural Exit
30. In Section 5: Check mark the Short Signal Exit
31. In Section 5: Check mark the Short Price Event Exit
32. In Section 5: Check mark the Short Stochastic Exit
33. In Section 6: Input 120 Rise Event NetChg
34. In Section 6: Input 1 Rise Event ROC
35. In Section 6: Input 5 Min Above Zero ZScore
36. In Section 6: Input 120 Fall Event NetChg
37. In Section 6: Input 1 Fall Event ROC
38. In Section 6: Input 5 Min Below Zero ZScore
In this configuration we are trading in long only mode and have enabled downward pyramiding. The purple trend line is based on the day (1440) period. The length is set at 90 days so it’s going to take a while for the trend line to alter course should this symbol decide to node dive for a prolonged amount of time. Your trades will still go long under those circumstances. Since downward accumulation is enabled, your position size will grow on the way down.
The performance example is Bitcoin so we assume the trader is buying coins outright. That being the case we don’t need a stop since we will never receive a margin call. New buy signals will be generated when the price exceeds the magnitude and speed defined by the Event Net Change and Rate of Change.
Feel free to PM me with any questions related to this script. Thank you and happy trading!
 CFTC RULE 4.41 
These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.






















